Skip to content

Commit

Permalink
Spotlight: added scaffholding for closing the modal on blur
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiospampinato committed Aug 29, 2023
1 parent 2f7df7c commit 8387c5b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions shortcuts/spotlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,16 @@ const onClose = () => {

};

const onBlur = () => { //FIXME: This event isn't fired after the first one, for some reason

if ( !STATE.modal ) return;

if ( STATE.time > ( Date.now () - 100 ) ) return;

onClose ();

};

const onSearch = query => {

if ( !query ) {
Expand Down Expand Up @@ -122,3 +132,5 @@ const onEnter = () => {
};

Key.on ( 'space', ['ctrl'], onToggle );

setEventHandler ( 'windowDidFocus', onBlur);

0 comments on commit 8387c5b

Please sign in to comment.