Skip to content

Commit

Permalink
Close quick-search modal on ctrl+space
Browse files Browse the repository at this point in the history
  • Loading branch information
divyanshiGupta committed Jun 22, 2022
1 parent 2ad4e17 commit 61ef4c2
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ const QuickSearchModalBody: React.FC<QuickSearchModalBodyProps> = ({
const onKeyDown = (e: KeyboardEvent) => {
switch (e.code) {
case 'Escape': {
e.preventDefault();
onCancel();
break;
}
Expand All @@ -219,9 +220,17 @@ const QuickSearchModalBody: React.FC<QuickSearchModalBodyProps> = ({
break;
}
case 'Enter': {
e.preventDefault();
onEnter(e);
break;
}
case 'Space': {
if (e.ctrlKey) {
e.preventDefault();
closeModal();
}
break;
}
default:
}
};
Expand Down

0 comments on commit 61ef4c2

Please sign in to comment.