Closed zhaoyao91 closed 2 years ago
It is used in safari. After entering Chinese, the cursor is always at the front of the paragraph. This problem is very disturbing. I don't know how the problem is solved. I use the latest version of 0.57.1.
I can confirm similar issues with Microsoft IME whenever using IME input at offset 0 behind another element.
The IME widget will modify the wrong dom element.
My workaround is to insert a character without IME first, then use IME input, then deleting the character again
it's about IME. Chinsese can not be used well on slate right now. because IME related DOM event damage React Reconciliation.
confirm that it still appears on safari right now with version 0.59.0
version 0.65 still has this problem, input chinese after a void node; use macos ,when u 'ArrowLeft' or 'ArrowRight' choose a chinese word ,the cursor incorrect
+1
I believe what needs to be done is to add an empty whitespace character after the mention gets inserted. At least I think that's what we did for the implementation in Plate.
In the earlier slate-angular fixed this problem, mention example: http://slate-angular.ngnice.com/mentions, probably the problem is that the tag containing the [data-slate-spacer="true"] will interrupt the IME input, so slate-angular move all [data-slate-spacer="true"] tag to the front of [void text] to avoid IME input being interrupted, it has been working fine in Prod environment for a while without any additional issues, I plan to submit a PR with such changes.
slate-react DOM:
slate-angular DOM:
d
I asked you this question in Zhihu last week. It bothered me for a long time. Thank you
Changing it like I did fixed the topmost problem, but it introduced a new bug that triggered the whole editor to crash when moving the cursor left in Chinese input to the inline-block element itself, and then I couldn't stop cursor movement by disabling the call to event.preventDefault in the slate's onKeyDown event. help
Do you want to request a feature or report a bug?
Bug
What's the current behavior?
https://www.slatejs.org/examples/mentions
Slate: I don't know Mac OS: 10.15.3 Chrome: 80.0.3987.87
What's the expected behavior?
When typing Chinese after the mention (void node), it could work fine, but it seems breaking the slate structure and the following typing is buggy.