Wrap view.dispatch in setTimeout (#21365)

GitOrigin-RevId: 61c19e10f9529b4d7913f01c57281931533153d2
This commit is contained in:
Alf Eaton
2024-10-25 12:31:53 +01:00
committed by Copybot
parent db919c0300
commit dfef2edbf6

View File

@@ -232,7 +232,9 @@ function useCodeMirrorScope(view: EditorView) {
spellCheckLanguage,
hunspellManager,
}
view.dispatch(setSpellCheckLanguage(spellingRef.current))
window.setTimeout(() => {
view.dispatch(setSpellCheckLanguage(spellingRef.current))
})
}, [view, spellCheckLanguage, hunspellManager])
const projectFeaturesRef = useRef(projectFeatures)