mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-25 16:20:49 +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:
5
.changeset/lazy-trainers-learn.md
Normal file
5
.changeset/lazy-trainers-learn.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'slate-react': patch
|
||||
---
|
||||
|
||||
fix onCompositionEnd update error.
|
@@ -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)
|
||||
|
Reference in New Issue
Block a user