3 ms·
Spellcheck and corrections can be faked, I think, if you decide to compile your own hunspell (or whatever). IME (i.e. entering text for languages that do not h
by mook 9y ago
Spellcheck and corrections can be faked, I think, if you decide to compile your own hunspell (or whatever). IME (i.e. entering text for languages that do not have a one-to-one mapping of key press to character), though, is a lot harder; you have no idea what languages the user has configured, and showing _everything_ in a list is impractical.
- mwcampbell 9y agoNot only IMEs for various languages, but also alternative forms of input such as speech recognition.
- steadicat 9y agoFew people seem to know about Composition Events: https://w3c.github.io/uievents/#events-compositionevents https://w3c.github.io/uievents/#events-compositionevents Using those, implementing IME should be relatively easy. The events tell you which partial characters to show, and which completed characters to insert.
- marijn 9y agoUnfortunately, it's not that easy. Composition events are typically controlled by the IME software, which is not part of the browser proper, and tends to be a lot less serious about conforming to standards. The result is that the data in those events often simply doesn't correspond to the actual DOM changes that they caused. On Android, you can't even rely on the fact that compositionstart fires when a composition is started—with some virtual keyboards (which act as IME providers) you routinely get compositionupdate or compositionend before a start event. Listening to these events and using DOM diffing can get you a more or less accurate idea of what happened. But 'relatively easy' does not apply.
- kijin 9y agoIME support sucks, even with contenteditable. I have yet to find a free contenteditable-based WYSIWYG editor that works properly with the Korean IME in recent versions of iOS. Duplicate characters everywhere. Even the Enter key sometimes works and sometimes doesn't, depending on what character is immediately before the line break. Froala is better, thanks to a Korean guy who helped develop a fix for them despite the fact that it's not even FOSS.
- scofalik 9y agoIt is true that working with IME is hard, even though it is kind of supported by operating system and browser. As much as it is doable for standalone editing, it is a nightmare for collaborative editing, where content changes all the time - not only at the place where you type. Each content change may cause composition (IME) to break. That's how the browser works. This is one of the reasons why "real-time collaborative editing" solutions often implement "block limiting" -- one block/paragraph can be edited only by one user at the same time. Enabling IME will be one of the toughest goals for CKE5's collaborative editing solution - Letters: https://ckeditor.com/letters/ https://ckeditor.com/letters/