From 2abbd571576c881e558389ee87729d761abd7b7a Mon Sep 17 00:00:00 2001 From: elvin7cf <56380896+Elvin7CF@users.noreply.github.com> Date: Tue, 19 Dec 2023 13:02:49 +0800 Subject: [PATCH 1/2] fix: onCompositionEnd not updating isComposing --- packages/slate-react/src/components/editable.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/slate-react/src/components/editable.tsx b/packages/slate-react/src/components/editable.tsx index 1a87500461..f70bf43258 100644 --- a/packages/slate-react/src/components/editable.tsx +++ b/packages/slate-react/src/components/editable.tsx @@ -1114,7 +1114,7 @@ export const Editable = (props: EditableProps) => { (event: React.CompositionEvent) => { if (ReactEditor.hasSelectableTarget(editor, event.target)) { if (ReactEditor.isComposing(editor)) { - Promise.resolve(() => { + Promise.resolve().then(() => { setIsComposing(false) IS_COMPOSING.set(editor, false) }) From 0f5b5efc0da50a773d1e018220d0809efbf7a7a7 Mon Sep 17 00:00:00 2001 From: elvin7cf <56380896+Elvin7CF@users.noreply.github.com> Date: Tue, 19 Dec 2023 14:28:37 +0800 Subject: [PATCH 2/2] Add changeset --- .changeset/light-bulldogs-refuse.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/light-bulldogs-refuse.md diff --git a/.changeset/light-bulldogs-refuse.md b/.changeset/light-bulldogs-refuse.md new file mode 100644 index 0000000000..d564524b1e --- /dev/null +++ b/.changeset/light-bulldogs-refuse.md @@ -0,0 +1,5 @@ +--- +'slate-react': patch +--- + +Fix onCompositionEnd not updating isComposing