Can not input chinese in safari #2457
I've been working on these Chinese input issues for a few days. There're actually two issues when it comes to typing Chinese in safari browser (Mac OS 10.12.6, Safari 10.1.2).
The first issue: editor doesn't insert Chinese character after word selection, i.e. it doesn't insert anything when composition is over. For browsers like Chrome without support for input events level 2, editor would simply call insertText() in onBeforeInput function as an after plugin. But for safari browser, editor decides what to do next depending on event.inputType, it seems the case 'insertFromComposition' is missed at this place. Therefore @hangzz 's solution would do the trick, which makes editor insert composition result.
The second issue: one key stroke inserts two characters when composing Chinese at end of block, which is the issue mentioned above. Seems it has something to do with onSelect after plugin, commenting out the second last line in that function
makes word composing work, but it invalidates select action of course. I'm stuck at this place to make both select and word composition work. If anyone has any idea to fix this issue, it would be greatly appreciated.