fix(widgets): clear search box on item select via empty displayValue

reka-ui's ComboboxRoot defaults resetSearchTermOnBlur=true. After ComboboxItem.onSelect, the root closes and ~1ms later triggers ComboboxInput's resetSearchTerm, which without an explicit displayValue prop writes rootModelValue.toString() — i.e. the selected item's id — into the input. Our v-model on the input propagates that into ctx.searchQuery, so reopening the dropdown shows the id in the search box and a single-item filtered list.

Pass displayValue={() => ''} on ComboboxInput so reset always writes '' instead. Smallest surface, contract sits right next to the v-model it's correcting.
This commit is contained in:
Glary-Bot
2026-05-17 16:29:07 +00:00
parent 65b436daa9
commit d1652c2c5c

View File

@@ -18,6 +18,8 @@ if (!ctx) {
}
const { t } = useI18n()
const emptyDisplayValue = () => ''
</script>
<template>
@@ -28,6 +30,7 @@ const { t } = useI18n()
/>
<ComboboxInput
v-model="ctx.searchQuery.value"
:display-value="emptyDisplayValue"
:placeholder="placeholder ?? t('g.search')"
class="w-full border-none bg-transparent text-xs text-base-foreground outline-none placeholder:text-muted-foreground"
:aria-label="