feat(popover): add closeOnOutsideClick prop

This commit is contained in:
Eric Y Liu 2021-03-19 08:21:52 -07:00
commit b728454a60
6 changed files with 81 additions and 12 deletions

20
tests/Popover.test.svelte Normal file
View file

@ -0,0 +1,20 @@
<script lang="ts">
import { Popover } from "../types";
let open = false;
</script>
<Popover
bind:open
closeOnOutsideClick
align="right"
caret
relative
light
highContrast
on:click:outside="{() => {
console.log('on:click:outside');
}}"
>
<div style="padding: var(--cds-spacing-05)">Content</div>
</Popover>