From 9c3cbff5f1026697df0b209d6add736e7d4d346a Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Tue, 24 Sep 2024 12:04:45 +0800 Subject: feat: add util "removeBlockFocus" --- src/editor.mjs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/editor.mjs') diff --git a/src/editor.mjs b/src/editor.mjs index f4fadb4..35b1949 100644 --- a/src/editor.mjs +++ b/src/editor.mjs @@ -570,6 +570,10 @@ document.onkeydown = (e) => { e.preventDefault() dumbymap.utils.focusNextBlock(true) } + if (e.key === 'Escape') { + e.preventDefault() + dumbymap.utils.removeBlockFocus() + } } } -- cgit v1.2.3-70-g09d2