[web] Remove blanks in the search query before launching a search

This commit is contained in:
Alain Nussbaumer 2024-04-20 22:20:50 +02:00
parent 6a93172cb9
commit 5ce78d041d
2 changed files with 2 additions and 1 deletions

View File

@ -177,6 +177,7 @@ export default {
this.search_types = SEARCH_TYPES
this.search_limit = PAGE_SIZE
}
this.search_query = this.search_query.trim()
if (!this.search_query || !this.search_query.replace(/^query:/u, '')) {
this.$refs.search_field.focus()
return

View File

@ -144,7 +144,6 @@ export default {
this.search_types = [type]
this.search_parameters.limit = PAGE_SIZE_EXPANDED
this.search_parameters.offset = 0
this.search()
},
open_search(query) {
@ -168,6 +167,7 @@ export default {
this.search_types = SEARCH_TYPES
this.search_parameters.limit = PAGE_SIZE
}
this.search_query = this.search_query.trim()
if (!this.search_query) {
this.$refs.search_field.focus()
return