fix: Disable clear filter button in add filter dropdown (#9226)

This commit is contained in:
Sivin Varghese
2024-04-12 13:38:51 +05:30
committed by GitHub
parent 3b6ae772bf
commit dc757598f1
3 changed files with 11 additions and 1 deletions

View File

@@ -60,6 +60,7 @@ const closeDropdown = () => emit('closeDropdown');
<filter-list-dropdown
v-if="options"
v-on-clickaway="closeDropdown"
show-clear-filter
:list-items="options"
:active-filter-id="id"
:input-placeholder="placeholder"

View File

@@ -8,6 +8,10 @@ defineProps({
type: String,
default: '',
},
showClearFilter: {
type: Boolean,
default: false,
},
});
</script>
<template>
@@ -30,7 +34,7 @@ defineProps({
</div>
<!-- Clear filter button -->
<woot-button
v-if="!inputValue"
v-if="!inputValue && showClearFilter"
size="small"
variant="clear"
color-scheme="primary"

View File

@@ -22,6 +22,10 @@ const props = defineProps({
type: Number,
default: null,
},
showClearFilter: {
type: Boolean,
default: false,
},
});
const searchTerm = ref('');
@@ -54,6 +58,7 @@ const isFilterActive = id => {
v-if="enableSearch && listItems.length"
:input-value="searchTerm"
:input-placeholder="inputPlaceholder"
:show-clear-filter="showClearFilter"
@input="onSearch"
@click="$emit('removeFilter')"
/>