mweiss / elm-rte-toolkit

A toolkit for creating rich text editors in Elm
https://mweiss.github.io/elm-rte-toolkit/
BSD 3-Clause "New" or "Revised" License
149 stars 14 forks source link

fix issue #10, add IME support for chrome and safari #12

Closed mweiss closed 4 years ago

mweiss commented 4 years ago

10 This fixes IME support in chrome for desktop/mobile, and Safari.

Some more details on this implementation: 1) Reverts a performance improvement to return the modified editor on shouldPreventDefault for keydown and beforeinput. Unfortunately, it sometimes can have a stale editor state, since the state gets passed in the view, not in the update method 2) Adds a custom editorcompositionend event which gets fired after the original to fix issues in some browsers where the final keydown and input event are fired after the composition event. 3) For android, makes sure that compositionend gets called eventually, since sometimes Android will never fire it.