Merge pull request #5636 from NadavTasher/bugfix/esc-keyboard-shortcut-not-working

Always handle the escape key when shortcuts are enabled
This commit is contained in:
Lauri Ojansivu 2024-12-30 00:39:53 +02:00 committed by GitHub
commit 133066c900
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -23,6 +23,10 @@ Mousetrap.stopCallback = (e, element) => {
if (!ReactiveCache.getCurrentUser().isKeyboardShortcuts())
return true;
// Always handle escape
if (e.keyCode === 27)
return false;
// Make sure there are no selected characters
if (window.getSelection().type === "Range")
return true;