fix: issue where plaintext editor autofocus would interfere with sign in form

This commit is contained in:
Mo
2022-11-25 06:41:40 -06:00
parent 21611d9b45
commit a6efc5336b
2 changed files with 15 additions and 13 deletions

View File

@@ -132,9 +132,15 @@ export const PlainEditor = forwardRef<PlainEditorInterface, Props>(
useEffect(() => {
if (controller.isTemplateNote && controller.templateNoteOptions?.autofocusBehavior === 'editor') {
setTimeout(() => {
focusEditor()
})
focusEditor()
}
}, [controller, focusEditor])
useEffect(() => {
const shouldFocus = controller.isTemplateNote && controller.templateNoteOptions?.autofocusBehavior === 'editor'
if (shouldFocus) {
focusEditor()
}
}, [controller, focusEditor])
@@ -155,6 +161,10 @@ export const PlainEditor = forwardRef<PlainEditorInterface, Props>(
}, [reloadPreferences, application])
useEffect(() => {
if (previousSpellcheck === undefined) {
return
}
if (spellcheck !== previousSpellcheck) {
setTextareaUnloading(true)
setTimeout(() => {