mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-21 21:09:00 +00:00
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:
@@ -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="
|
||||
|
||||
Reference in New Issue
Block a user