Skip to content

fix: Block insert twice when using korean at suggestion #1034

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

Merged
merged 2 commits into from
Aug 28, 2024

Conversation

d2n0s4ur
Copy link
Contributor

Any languages with composition sessions (Korean, Japanese, etc..) have isComposing at keydown events.

Because of this, using the Korean suggestion make two same blocks(ex. /이미지, /구분선).
(If you press Enter after typing Korean, the keyDown event is fired both when the isComposing state is true and when it is false, resulting in two blocks with duplicate events.)

to prevent this situation, checking event.isComposing is necessary.

by simply adding checking event.isCompoising == false, We can prevent making blocks twice when using Korean.

here is the MDN page that explains isComposing

https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/isComposing

Copy link

vercel bot commented Aug 27, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
blocknote ✅ Ready (Inspect) Visit Preview Aug 28, 2024 5:25pm
blocknote-website ✅ Ready (Inspect) Visit Preview Aug 28, 2024 5:25pm

Copy link

vercel bot commented Aug 27, 2024

@d2n0s4ur is attempting to deploy a commit to the TypeCell Team on Vercel.

A member of the Team first needs to authorize it.

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

Successfully merging this pull request may close these issues.

2 participants