Skip to content

Commit a331176

Browse files
authored
fix: filter search cannot be typed (#1376)
1 parent c3090e0 commit a331176

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

app/components/Filter/Panel.vue

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ const { t } = useI18n()
3232
const isExpanded = shallowRef(false)
3333
const showAllKeywords = shallowRef(false)
3434
35+
const filterText = computed({
36+
get: () => props.filters.text,
37+
set: value => emit('update:text', value),
38+
})
39+
3540
const displayedKeywords = computed(() => {
3641
const keywords = props.availableKeywords ?? []
3742
return showAllKeywords.value ? keywords : keywords.slice(0, 20)
@@ -130,11 +135,6 @@ function getSecurityLabelKey(value: SecurityFilter): string {
130135
return securityLabelKeys.value[value]
131136
}
132137
133-
function handleTextInput(event: Event) {
134-
const target = event.target as HTMLInputElement
135-
emit('update:text', target.value)
136-
}
137-
138138
// Compact summary of active filters for collapsed header using operator syntax
139139
const filterSummary = computed(() => {
140140
const parts: string[] = []
@@ -242,13 +242,12 @@ const hasActiveFilters = computed(() => !!filterSummary.value)
242242
<InputBase
243243
id="filter-search"
244244
type="text"
245-
:value="filters.text"
245+
v-model="filterText"
246246
:placeholder="searchPlaceholder"
247247
autocomplete="off"
248248
class="w-full min-w-25"
249249
size="medium"
250250
no-correct
251-
@input="handleTextInput"
252251
/>
253252
</div>
254253

0 commit comments

Comments
 (0)