Open palindrom615 opened 5 years ago
I think this issue is not so trivial because I've found some people complaining about writing facebook post or messenger with linux and chrome...
IIRC Safari on Mac needs that for typing to work in Korean. Unfortunately every browser sends different events and it is really hard to know what will work on all of them.
@sophiebits , i just tested removed version of draft-js with macOS 10.14.1 and safari 12.0.1 and it seems no problem.
Can you share some more specific info about #666?
Not sure if it's same issue or not, but it also happens for Japanese with fcitx mozc (the defacto standard Japanese input method) on ArchLinux.
It seems it's related with https://bugs.chromium.org/p/chromium/issues/detail?id=695326
The current issue title might have been misleading, since it's been over a year since it's broken.
suggested change:
BEFORE: typing Korean in linux, chrome/electron is buggy AFTER: typing Korean and Japanese in linux, chrome/electron are broken
Please note that all the electron apps that use draft.js are unusable in Linux due to this problem.
This is still broken for Japanese input in the latest version.
Do you want to request a feature or report a bug?
bug.
What is the current behavior?
the first korean letter after
compositionend
event is ignored.Which versions of Draft.js, and which browser / OS are affected by this issue? Did this work in previous versions of Draft.js?
after commit 07b1eb847fb801d61b41a7a03c7c26c80cca5478. I have tested windows and fedora 29 and the bug happened only on chrome or electron in linux fedora 29.
I think I found the reason why bug happens.
at chrome in linux,
beforeinput
event occurs betweencompositionend
and followingcompositionstart
, unlike that of windows. So when typing new Korean character,beforeinput
event handler of modeedit
https://github.com/facebook/draft-js/blob/3400cdafb465640c41d3728d52ed59e8f13ad78a/src/component/handlers/edit/editOnBeforeInput.js#L80 is called instead of modecomposite
. https://github.com/facebook/draft-js/blob/3400cdafb465640c41d3728d52ed59e8f13ad78a/src/component/handlers/composition/DraftEditorCompositionHandler.js#L48yeah that is chromium's own bug, but we can bypass the bug by not to change mode from
composite
toedit
.https://github.com/facebook/draft-js/blob/3400cdafb465640c41d3728d52ed59e8f13ad78a/src/component/handlers/composition/DraftEditorCompositionHandler.js#L90
The mode is changed because of invalid
stillComposing
flag, so by removing the if statement above, the bug fixed.Actually, I cannot catch logic of the statement or even comments. Can @sophiebits or anyone help me understand the code? At least I cannot find any bug without that part. Maybe because I don't have any macOS...