Enable resetting search input

This commit is contained in:
kolaente 2020-05-22 17:32:18 +02:00
parent 8592652e5b
commit 0953400321
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B
2 changed files with 4 additions and 3 deletions

View file

@ -19,8 +19,7 @@
<button
class="button noshadow is-primary"
@click="searchTasks"
:class="{'is-loading': taskCollectionService.loading}"
:disabled="searchTerm === ''">
:class="{'is-loading': taskCollectionService.loading}">
Search
</button>
</div>

View file

@ -112,9 +112,11 @@ export default {
})
},
searchTasks() {
if (this.searchTerm === '') {
// Only search if the search term changed
if (this.$route.query === this.searchTerm) {
return
}
this.$router.push({
name: 'list.list',
query: {search: this.searchTerm}