Merge pull request #15052 from GitStartHQ/fix/editor-wrong-focus-checking

fix: wrong editor focus checking method
This commit is contained in:
Gustav Hansen 2022-12-06 12:27:29 +01:00 committed by GitHub
commit ee3f87243f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,7 +43,7 @@ const Editor = ({
}, [editorRef, textareaRef, name, placeholder]);
useEffect(() => {
if (value && !editorRef.current.state.focused) {
if (value && !editorRef.current.hasFocus()) {
editorRef.current.setValue(value);
}
}, [editorRef, value]);