diff --git a/.changeset/polite-rivers-roll.md b/.changeset/polite-rivers-roll.md new file mode 100644 index 000000000..f545060a5 --- /dev/null +++ b/.changeset/polite-rivers-roll.md @@ -0,0 +1,5 @@ +--- +'svelte-ux': patch +--- + +Dispatch `apply` event when applying from MultiSelect diff --git a/packages/svelte-ux/src/lib/components/MultiSelectField.svelte b/packages/svelte-ux/src/lib/components/MultiSelectField.svelte index 9837a6b49..10ef73c4e 100644 --- a/packages/svelte-ux/src/lib/components/MultiSelectField.svelte +++ b/packages/svelte-ux/src/lib/components/MultiSelectField.svelte @@ -62,6 +62,9 @@ export let menuProps: Omit | undefined = undefined; + // Passthrough onApply event + export let onApply: MultiSelectMenuProps['onApply'] | undefined = undefined; + const logger = new Logger('MultiSelectField'); let open = false; @@ -213,6 +216,7 @@ {placement} {infiniteScroll} {searchText} + {onApply} classes={{ ...settingsClasses.multiSelectMenu, ...classes.multiSelectMenu }} matchWidth bind:open diff --git a/packages/svelte-ux/src/lib/components/MultiSelectMenu.svelte b/packages/svelte-ux/src/lib/components/MultiSelectMenu.svelte index a45e35d32..185041669 100644 --- a/packages/svelte-ux/src/lib/components/MultiSelectMenu.svelte +++ b/packages/svelte-ux/src/lib/components/MultiSelectMenu.svelte @@ -37,6 +37,9 @@ const settingsClasses = getComponentClasses('MultiSelectMenu'); export let menuItemsEl: HTMLMenuElement | undefined = undefined; + + // Passthrough onApply event + export let onApply: MultiSelectProps['onApply'] | undefined = undefined;