2 ms·
> contenteditable gets you 60% of the way there but is so buggy and inconsistent that you have to override all its behavior anyway. Believe me, I know. I did m
by nicoburns 7y ago
> contenteditable gets you 60% of the way there but is so buggy and inconsistent that you have to override all its behavior anyway.
Believe me, I know. I did my own once upon a time (back when IE6 was still a thing, and supporting IE-style ranges was required!). How do you deal with things like the caret if you're rolling your own. Just fake it with a div?
- jhpriestley 7y agoI think there was a text input element that you actually typed into, which showed the cursor and handled IME. After composing a character, that character would be rendered into a div and the input element moved to the next position. I've also written versions with a blinking div, or a canvas element, but I think the input element is the better approach to leverage browser IME.