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

View file

@ -9,6 +9,12 @@ export interface PopoverProps
*/
open?: boolean;
/**
* Set to `true` to close the popover on an outside click
* @default false
*/
closeOnOutsideClick?: boolean;
/**
* Set to `true` render a caret
* @default false
@ -54,6 +60,6 @@ export interface PopoverProps
export default class Popover extends SvelteComponentTyped<
PopoverProps,
{},
{ ["click:outside"]: CustomEvent<any> },
{ default: {} }
> {}