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

can't input Chinese characters IOS, but can input English characters. #5703

Open
TianYu0605 opened this issue Aug 21, 2024 · 3 comments
Open

Comments

@TianYu0605
Copy link

TianYu0605 commented Aug 21, 2024

Description
I used Safari on my iPhone to open the example(https://www.slatejs.org/examples/richtext) provided by Slate, and found that I could not input Chinese. The following is the error I got when I opened it with the iOS simulator. At the same time, I found that if I used English as the first word and Chinese as the subsequent words, it could be input normally.

Recording
When the editor value is empty, entering Chinese will result in an error and cannot be deleted.
https://github.com/user-attachments/assets/61c6f15c-db26-46cd-a2b4-065771552009
Enter some English first, then enter Chinese, and you can enter and delete normally.
The following is the error information:
image

Expectation
I hope that when the editor is empty, I can input Chinese normally and the console will not report an error.

Environment

  • Slate Version: [0.103.0]
  • Slate-react Version: [0.108.0]
  • Operating System: [iOS 15.0]
  • Browser: [Safari 17.2]
@TianYu0605
Copy link
Author

Enter some English first, then enter Chinese, and you can enter and delete normally.
https://github.com/user-attachments/assets/96e7f308-f152-44cc-bc93-450d3d13f183

@daddybh
Copy link

daddybh commented Aug 27, 2024

I looks like safari will break slate's dom structure at beforeinput event inputType = deleteCompositionText.

there is a workaround to trick safari which mentioned at ProseMirror/prosemirror#934

It works for me, you can give it a shot.

@daddybh
Copy link

daddybh commented Aug 27, 2024

And this bug was brought in at this PR #5654.

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

No branches or pull requests

2 participants