From 5ce4ec58fee4b197f6a6e713520e5f43b3b1439e Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Sat, 19 Mar 2022 08:36:17 -0700 Subject: [PATCH] feat(combo-box): make ComboBox slottable Closes #1176 --- src/ComboBox/ComboBox.svelte | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ComboBox/ComboBox.svelte b/src/ComboBox/ComboBox.svelte index be693f34..ae0967f8 100644 --- a/src/ComboBox/ComboBox.svelte +++ b/src/ComboBox/ComboBox.svelte @@ -3,6 +3,7 @@ * @typedef {any} ComboBoxItemId * @typedef {{ id: ComboBoxItemId; text: string; }} ComboBoxItem * @event {{ selectedId: ComboBoxItemId; selectedItem: ComboBoxItem }} select + * @slot {{ item: ComboBoxItem; index: number }} */ /** @@ -363,7 +364,9 @@ highlightedIndex = i; }}" > - {itemToString(item)} + + {itemToString(item)} + {#if selectedItem && selectedItem.id === item.id} {/if}