mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-20 08:01:46 +03:00
chore: consider "contextmenu" event as a click outside event too
This commit is contained in:
parent
52607dfb75
commit
0fddf1bc5b
@ -15,15 +15,19 @@ export function clickOutside(
|
||||
}
|
||||
}
|
||||
document.addEventListener('click', onClick, true);
|
||||
document.addEventListener('contextmenu', onClick, true);
|
||||
return {
|
||||
destroy() {
|
||||
document.removeEventListener('click', onClick, true);
|
||||
document.removeEventListener('contextmenu', onClick, true);
|
||||
},
|
||||
update(opts: ClickOpts) {
|
||||
document.removeEventListener('click', onClick, true);
|
||||
document.removeEventListener('contextmenu', onClick, true);
|
||||
if (opts.enabled !== undefined && !opts.enabled) return;
|
||||
trigger = opts.trigger;
|
||||
document.addEventListener('click', onClick, true);
|
||||
document.addEventListener('contextmenu', onClick, true);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user