Skip to content

Commit

Permalink
Fix onCompositionEnd not updating isComposing (#5584)
Browse files Browse the repository at this point in the history
* fix: onCompositionEnd not updating isComposing

* Add changeset
  • Loading branch information
Elvin7CF authored Dec 21, 2023
1 parent 8ba3a9c commit 884ab42
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/light-bulldogs-refuse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'slate-react': patch
---

Fix onCompositionEnd not updating isComposing
2 changes: 1 addition & 1 deletion packages/slate-react/src/components/editable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1114,7 +1114,7 @@ export const Editable = (props: EditableProps) => {
(event: React.CompositionEvent<HTMLDivElement>) => {
if (ReactEditor.hasSelectableTarget(editor, event.target)) {
if (ReactEditor.isComposing(editor)) {
Promise.resolve(() => {
Promise.resolve().then(() => {
setIsComposing(false)
IS_COMPOSING.set(editor, false)
})
Expand Down

0 comments on commit 884ab42

Please sign in to comment.