Enable resetting search input
This commit is contained in:
parent
8592652e5b
commit
0953400321
2 changed files with 4 additions and 3 deletions
|
@ -19,8 +19,7 @@
|
||||||
<button
|
<button
|
||||||
class="button noshadow is-primary"
|
class="button noshadow is-primary"
|
||||||
@click="searchTasks"
|
@click="searchTasks"
|
||||||
:class="{'is-loading': taskCollectionService.loading}"
|
:class="{'is-loading': taskCollectionService.loading}">
|
||||||
:disabled="searchTerm === ''">
|
|
||||||
Search
|
Search
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -112,9 +112,11 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
searchTasks() {
|
searchTasks() {
|
||||||
if (this.searchTerm === '') {
|
// Only search if the search term changed
|
||||||
|
if (this.$route.query === this.searchTerm) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
name: 'list.list',
|
name: 'list.list',
|
||||||
query: {search: this.searchTerm}
|
query: {search: this.searchTerm}
|
||||||
|
|
Loading…
Reference in a new issue