diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-22 15:09:12 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-22 15:09:12 +0300 |
commit | faec73b0fe1b2f19646363e4359f302fc1b9414c (patch) | |
tree | 09e887c8737a516926917fc0c0e8b675bf6fcac4 /app/assets/javascripts/vue_shared/components/filtered_search_bar | |
parent | e9a834ee298801dec92de77783fffa0cea9deb34 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/vue_shared/components/filtered_search_bar')
-rw-r--r-- | app/assets/javascripts/vue_shared/components/filtered_search_bar/filtered_search_bar_root.vue | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/app/assets/javascripts/vue_shared/components/filtered_search_bar/filtered_search_bar_root.vue b/app/assets/javascripts/vue_shared/components/filtered_search_bar/filtered_search_bar_root.vue index 9dc5c5db276..7c1828f2294 100644 --- a/app/assets/javascripts/vue_shared/components/filtered_search_bar/filtered_search_bar_root.vue +++ b/app/assets/javascripts/vue_shared/components/filtered_search_bar/filtered_search_bar_root.vue @@ -171,15 +171,17 @@ export default { * This watcher listens for updates to `filterValue` on * such instances. :( */ - filterValue(value) { - const [firstVal] = value; + filterValue(newValue, oldValue) { + const [firstVal] = newValue; if ( !this.initialRender && - value.length === 1 && + newValue.length === 1 && firstVal.type === 'filtered-search-term' && !firstVal.value.data ) { - this.$emit('onFilter', []); + const filtersCleared = + oldValue[0].type !== 'filtered-search-term' || oldValue[0].value.data !== ''; + this.$emit('onFilter', [], filtersCleared); } // Set initial render flag to false |