mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-19 23:31:21 +02:00
Fix blur de-select speed
This commit is contained in:
@@ -151,9 +151,11 @@ function getExtensions({
|
|||||||
// Clear selection on blur
|
// Clear selection on blur
|
||||||
EditorView.domEventHandlers({
|
EditorView.domEventHandlers({
|
||||||
blur: (e, view) => {
|
blur: (e, view) => {
|
||||||
|
// Clear selection on blur. Must do on next tick or updating selection
|
||||||
|
// will keep the editor focused
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
view.dispatch({ selection: { anchor: 0, head: 0 } });
|
view.dispatch({ selection: { anchor: 0, head: 0 } }, { userEvent: 'blur' });
|
||||||
}, 100);
|
});
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user