fix: Disable clear filter button in add filter dropdown (#9226)
This commit is contained in:
@@ -60,6 +60,7 @@ const closeDropdown = () => emit('closeDropdown');
|
|||||||
<filter-list-dropdown
|
<filter-list-dropdown
|
||||||
v-if="options"
|
v-if="options"
|
||||||
v-on-clickaway="closeDropdown"
|
v-on-clickaway="closeDropdown"
|
||||||
|
show-clear-filter
|
||||||
:list-items="options"
|
:list-items="options"
|
||||||
:active-filter-id="id"
|
:active-filter-id="id"
|
||||||
:input-placeholder="placeholder"
|
:input-placeholder="placeholder"
|
||||||
|
|||||||
@@ -8,6 +8,10 @@ defineProps({
|
|||||||
type: String,
|
type: String,
|
||||||
default: '',
|
default: '',
|
||||||
},
|
},
|
||||||
|
showClearFilter: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
@@ -30,7 +34,7 @@ defineProps({
|
|||||||
</div>
|
</div>
|
||||||
<!-- Clear filter button -->
|
<!-- Clear filter button -->
|
||||||
<woot-button
|
<woot-button
|
||||||
v-if="!inputValue"
|
v-if="!inputValue && showClearFilter"
|
||||||
size="small"
|
size="small"
|
||||||
variant="clear"
|
variant="clear"
|
||||||
color-scheme="primary"
|
color-scheme="primary"
|
||||||
|
|||||||
@@ -22,6 +22,10 @@ const props = defineProps({
|
|||||||
type: Number,
|
type: Number,
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
|
showClearFilter: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const searchTerm = ref('');
|
const searchTerm = ref('');
|
||||||
@@ -54,6 +58,7 @@ const isFilterActive = id => {
|
|||||||
v-if="enableSearch && listItems.length"
|
v-if="enableSearch && listItems.length"
|
||||||
:input-value="searchTerm"
|
:input-value="searchTerm"
|
||||||
:input-placeholder="inputPlaceholder"
|
:input-placeholder="inputPlaceholder"
|
||||||
|
:show-clear-filter="showClearFilter"
|
||||||
@input="onSearch"
|
@input="onSearch"
|
||||||
@click="$emit('removeFilter')"
|
@click="$emit('removeFilter')"
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user