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 1407c9062d
commit 516a7abc2a

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)