1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-23 07:22:55 +02:00

fix: fix onCompositionEnd update error (#5576)

* fix: fix onCompositionEnd update error

* Update packages/slate-react/src/components/editable.tsx

* add changeset

* Update .changeset/lazy-trainers-learn.md

---------

Co-authored-by: linqirong <609413692@qq.com>
Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
This commit is contained in:
qirong77
2023-12-06 23:59:21 +08:00
committed by GitHub
parent 26351b900f
commit 8ce52fd494
2 changed files with 9 additions and 2 deletions

View File

@@ -1114,8 +1114,10 @@ export const Editable = (props: EditableProps) => {
(event: React.CompositionEvent<HTMLDivElement>) => {
if (ReactEditor.hasSelectableTarget(editor, event.target)) {
if (ReactEditor.isComposing(editor)) {
setIsComposing(false)
IS_COMPOSING.set(editor, false)
Promise.resolve(() => {
setIsComposing(false)
IS_COMPOSING.set(editor, false)
})
}
androidInputManagerRef.current?.handleCompositionEnd(event)