Skip to content

Commit

Permalink
fix(Autocomplete): trim query while searching (#169)
Browse files Browse the repository at this point in the history
  • Loading branch information
BreadGenie authored Aug 9, 2024
1 parent bb6bce9 commit cf4e7d3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/Autocomplete.vue
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,10 @@ export default {
if (!this.query) return options
return options.filter((option) => {
return (
option.label.toLowerCase().includes(this.query.toLowerCase()) ||
option.value.toLowerCase().includes(this.query.toLowerCase())
option.label
.toLowerCase()
.includes(this.query.trim().toLowerCase()) ||
option.value.toLowerCase().includes(this.query.trim().toLowerCase())
)
})
},
Expand Down

0 comments on commit cf4e7d3

Please sign in to comment.