mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-19 05:31:56 +02:00
Fix useFocused
not updated when calling ReactEditor.focus
(#5593)
This commit is contained in:
@@ -447,8 +447,10 @@ export const ReactEditor: ReactEditorInterface = {
|
||||
Transforms.select(editor, Editor.start(editor, []))
|
||||
editor.onChange()
|
||||
}
|
||||
el.focus({ preventScroll: true })
|
||||
// IS_FOCUSED should be set before calling el.focus() to ensure that
|
||||
// FocusedContext is updated to the correct value
|
||||
IS_FOCUSED.set(editor, true)
|
||||
el.focus({ preventScroll: true })
|
||||
}
|
||||
},
|
||||
|
||||
|
Reference in New Issue
Block a user