fix: Clear search input which navigating to other tab/page (#2061)
This commit is contained in:
@@ -82,6 +82,7 @@ export default {
|
||||
...mapGetters({
|
||||
conversations: 'conversationSearch/getConversations',
|
||||
uiFlags: 'conversationSearch/getUIFlags',
|
||||
currentPage: 'conversationPage/getCurrentPage',
|
||||
}),
|
||||
resultsCount() {
|
||||
return this.conversations.length;
|
||||
@@ -111,10 +112,16 @@ export default {
|
||||
this.$store.dispatch('conversationSearch/get', { q: newValue });
|
||||
}, 1000);
|
||||
},
|
||||
currentPage() {
|
||||
this.clearSearchTerm();
|
||||
},
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.$store.dispatch('conversationSearch/get', { q: '' });
|
||||
bus.$on('clearSearchInput', () => {
|
||||
this.clearSearchTerm();
|
||||
});
|
||||
},
|
||||
|
||||
methods: {
|
||||
@@ -124,6 +131,9 @@ export default {
|
||||
closeSearch() {
|
||||
this.showSearchBox = false;
|
||||
},
|
||||
clearSearchTerm() {
|
||||
this.searchTerm = '';
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user