diff --git a/.changeset/fuzzy-cameras-eat.md b/.changeset/fuzzy-cameras-eat.md new file mode 100644 index 000000000..a08f75a6d --- /dev/null +++ b/.changeset/fuzzy-cameras-eat.md @@ -0,0 +1,5 @@ +--- +"bits-ui": patch +--- + +fix: allow overriding the combobox input id diff --git a/packages/bits-ui/src/lib/bits/combobox/components/combobox-input.svelte b/packages/bits-ui/src/lib/bits/combobox/components/combobox-input.svelte index 60670d24c..9cdb3c784 100644 --- a/packages/bits-ui/src/lib/bits/combobox/components/combobox-input.svelte +++ b/packages/bits-ui/src/lib/bits/combobox/components/combobox-input.svelte @@ -10,15 +10,21 @@ export let asChild: $$Props["asChild"] = false; export let placeholder: $$Props["placeholder"] = undefined; export let el: $$Props["el"] = undefined; + export let id: $$Props["id"] = undefined; const { elements: { input }, + ids, getAttrs, } = getCtx(); const dispatch = createDispatcher(); const attrs = getAttrs("input"); + $: if (id) { + ids.trigger.set(id); + } + $: builder = $input; $: Object.assign(builder, attrs);