-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixed4811: input Chinese at the end of link element, focus lose #4907
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m afraid this change, while it may fix this issue, is going to break other behavior. We are working to add a test suite for slate-react as this change isn’t currently covered by our tests.
okay |
Hi @dylans , I have the same issue here, May I ask what is the purpose of this code in const inline = Editor.above(editor, {
match: n => Editor.isInline(editor, n),
mode: 'highest',
})
if (inline) {
const [, inlinePath] = inline
if (Editor.isEnd(editor, selection.anchor, inlinePath)) {
const point = Editor.after(editor, inlinePath)!
Transforms.setSelection(editor, {
anchor: point,
focus: point,
})
}
} |
It was added as part of #4451 which fixed #4158 and #3888 . I think the change of removing these lines of code breaks IME in other ways. |
can't reproduction #4158 on my branch, i comment these lines const inline = Editor.above(editor, {
match: n => Editor.isInline(editor, n),
mode: 'highest',
})
if (inline) {
const [, inlinePath] = inline
if (Editor.isEnd(editor, selection.anchor, inlinePath)) {
const point = Editor.after(editor, inlinePath)!
Transforms.setSelection(editor, {
anchor: point,
focus: point,
})
}
} QQ20220328-172629-HD.mp4 |
@githoniel we'd appreciate your feedback on this one if you have time, as it's related to your PR from last year. Thanks! |
I will check this later |
@githoniel |
@sennpang |
No, i just comment these lines, i don't known why we should change selection when the focus at the end of inline element. |
I've just noticed this PR now. It looks like my PR #5541 is a duplicate of this. For what it's worth, I'm pretty sure that the offending code was left in unintentionally. Here's my analysis from issue #5540:
|
@dylans Can we try merging either this or my PR, on the understanding that we'll revert it immediately if it causes any IME issues more serious than the one it fixes? Currently, Plate's mentions are unusable for languages that use IMEs, and there's no simple workaround other than patching slate-react. |
Description
input Chinese at the end of link element, focus lose (maybe others IME also has this bug)
Issue
Fixes: #4811
Example
before:
https://user-images.githubusercontent.com/16861647/151319338-747db06d-6fd7-4f67-8e00-a61241456bfe.mp4
after:
https://user-images.githubusercontent.com/16861647/159625215-4ff51bba-ed5b-43a7-8ec1-1a1158a1004f.mov
Context
i wonder known why we should change selection when input end of inline element on compositionStart event, as i comment this lines, everything is okay.
Checks
yarn test
.yarn lint
. (Fix errors withyarn fix
.)yarn start
.)yarn changeset add
.)