I'm back to working on my RTE again (pure toddle) for my Shipped app project and I'm doing v2. I have created components for each element e.g. h1, p, etc., and the elements have contenteditable set to true.
On input, I'm getting event > target > textContent to get the content as I type and setting this in a variable in the component. I have the text node set to the variable content.
On input, this adds content to the text node (in reverse 🙄 ) but it's also adding content in the element as well e.g. <p>Some content<span>Some content</span></p>
I'd like to just populate the <span> (text node) with content that is input.
I did figure out a way to do this last year I'm sure but I just cannot figure it out.
Any pointers?