fix: close overlays on window click (#761)

This commit is contained in:
Phil Mayer 2021-07-22 12:44:23 -04:00 committed by GitHub
commit af26bdb10a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 24 additions and 16 deletions

View file

@ -165,13 +165,14 @@
{@html styles}
</svelte:head>
<svelte:body
<svelte:window
on:click="{({ target }) => {
if (buttonRef && buttonRef.contains(target)) return;
if (menuRef && !menuRef.contains(target)) {
open = false;
}
}}" />
}}"
/>
<button
bind:this="{buttonRef}"