Skip to content
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

editor will crash when input Chinese in the end of link element #4060

Closed
sennpang opened this issue Jan 28, 2021 · 3 comments
Closed

editor will crash when input Chinese in the end of link element #4060

sennpang opened this issue Jan 28, 2021 · 3 comments

Comments

@sennpang
Copy link
Contributor

Do you want to request a feature or report a bug?

bug

What's the current behavior?

Chrome GIF

Chrome behavior

input Chinese at end of link element, character will input twice, then move focus to left, the editor crush
Kapture 2021-01-28 at 12 05 09_Chrome

Safari GIF

Safari behavior

input Chinese at end of link element, then move focus to left, the editor crush
Kapture 2021-01-28 at 12 11 09_Safari

Firefox GIF

Firefox behavior

input Chinese at end of link element, then move focus to link element, then came back, input Chinese, the editor crush
Kapture 2021-01-28 at 12 15 07_Firefox

Slate: 0.XX.X (https://www.slatejs.org/examples/links)
Browser: Chrome / Safari / Firefox
OS: Mac

What's the expected behavior?

input Chinese with no errors

@ulion
Copy link
Contributor

ulion commented Jan 30, 2021

This only happens in chrome, imo. For now, I only figured out some ugly workaround for this, no idea whether introduce other side effect. The idea is to document.execCommand("undo") to remove the first unexpected input by ime, in custom onCompositionEnd.

@1c7
Copy link
Contributor

1c7 commented Jun 16, 2021

Hi, Any update on this?

@OldDream
Copy link
Contributor

OldDream commented Jul 28, 2022

This only happens in chrome, imo. For now, I only figured out some ugly workaround for this, no idea whether introduce other side effect. The idea is to document.execCommand("undo") to remove the first unexpected input by ime, in custom onCompositionEnd.

Thank you !
When I use sogou input before a inline element, the whole editor crashed. document.execCommand("undo") can fix this in 0.81.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants