diff --git a/src/components/multiselect/MultiSelect.vue b/src/components/multiselect/MultiSelect.vue index d08929cb6..e7847d908 100755 --- a/src/components/multiselect/MultiSelect.vue +++ b/src/components/multiselect/MultiSelect.vue @@ -190,6 +190,10 @@ export default { selectAll: { type: Boolean, default: null + }, + clearFilterOnHide: { + type: Boolean, + default: null } }, data() { @@ -285,6 +289,9 @@ export default { hide() { this.$emit('before-hide'); this.overlayVisible = false; + if (this.clearFilterOnHide) { + this.filterValue = null; + } }, onFocus() { this.focused = true; @@ -598,6 +605,9 @@ export default { originalEvent: event, target: this.$el }); + }, + clearFilter() { + this.filterValue = null; } }, computed: { diff --git a/src/views/multiselect/MultiSelectDemo.vue b/src/views/multiselect/MultiSelectDemo.vue index 3cdd33a0b..a68f522b5 100755 --- a/src/views/multiselect/MultiSelectDemo.vue +++ b/src/views/multiselect/MultiSelectDemo.vue @@ -27,7 +27,7 @@
Advanced with Templating and Filtering
- + + @@ -69,6 +74,7 @@ export default { selectedGroupedCities: null, selectedItems: null, selectAll: false, + // clearFilterOnHide: false, cities: [ {name: 'New York', code: 'NY'}, {name: 'Rome', code: 'RM'}, @@ -125,6 +131,9 @@ export default { }, onChange(event) { this.selectAll = event.value.length === this.items.length + }, + clearAdvancedTemplatingFilterInput() { + this.$refs.advancedMultiselect.clearFilter() } }, components: {