mirror of https://github.com/laurent22/joplin.git
Desktop: Handle compositionend event in TinyMCE (#3164)
parent
b2f1fac133
commit
80112e7b35
|
@ -808,6 +808,9 @@ const TinyMCE = (props:NoteBodyEditorProps, ref:any) => {
|
||||||
editor.on('keydown', onKeyDown);
|
editor.on('keydown', onKeyDown);
|
||||||
editor.on('keypress', onKeypress);
|
editor.on('keypress', onKeypress);
|
||||||
editor.on('paste', onPaste);
|
editor.on('paste', onPaste);
|
||||||
|
// `compositionend` means that a user has finished entering a Chinese
|
||||||
|
// (or other languages that require IME) character.
|
||||||
|
editor.on('compositionend', onChangeHandler);
|
||||||
editor.on('cut', onChangeHandler);
|
editor.on('cut', onChangeHandler);
|
||||||
editor.on('joplinChange', onChangeHandler);
|
editor.on('joplinChange', onChangeHandler);
|
||||||
editor.on('Undo', onChangeHandler);
|
editor.on('Undo', onChangeHandler);
|
||||||
|
@ -820,6 +823,7 @@ const TinyMCE = (props:NoteBodyEditorProps, ref:any) => {
|
||||||
editor.off('keydown', onKeyDown);
|
editor.off('keydown', onKeyDown);
|
||||||
editor.off('keypress', onKeypress);
|
editor.off('keypress', onKeypress);
|
||||||
editor.off('paste', onPaste);
|
editor.off('paste', onPaste);
|
||||||
|
editor.off('compositionend', onChangeHandler);
|
||||||
editor.off('cut', onChangeHandler);
|
editor.off('cut', onChangeHandler);
|
||||||
editor.off('joplinChange', onChangeHandler);
|
editor.off('joplinChange', onChangeHandler);
|
||||||
editor.off('Undo', onChangeHandler);
|
editor.off('Undo', onChangeHandler);
|
||||||
|
|
Loading…
Reference in New Issue