fix(context-menu): close menu when clicking anywhere

This commit is contained in:
Eric Y Liu 2021-06-27 08:20:44 -07:00
commit 1f99115c34

View file

@ -105,7 +105,7 @@
}}"
on:click="{(e) => {
if (!open) return;
if (e.target.contains(ref)) close();
close();
}}"
on:keydown="{(e) => {
if (open && e.key === 'Escape') close();