Fix blur de-select speed

This commit is contained in:
Gregory Schier
2023-03-09 10:57:34 -08:00
parent d8da396c2f
commit cb43f17efc

View File

@@ -151,9 +151,11 @@ function getExtensions({
// Clear selection on blur
EditorView.domEventHandlers({
blur: (e, view) => {
// Clear selection on blur. Must do on next tick or updating selection
// will keep the editor focused
setTimeout(() => {
view.dispatch({ selection: { anchor: 0, head: 0 } });
}, 100);
view.dispatch({ selection: { anchor: 0, head: 0 } }, { userEvent: 'blur' });
});
},
}),