Skip to content

Commit

Permalink
Autocomplete emit select event only if option selected actually change
Browse files Browse the repository at this point in the history
  • Loading branch information
adrlen authored and jtommy committed Feb 19, 2018
1 parent ab5f71e commit 8e135e9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/autocomplete/Autocomplete.vue
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,10 @@
newValue(value) {
this.$emit('input', value)
// Check if selected is invalid
if (this.getValue(this.selected) !== value) this.setSelected(null, false)
const currentValue = this.getValue(this.selected)
if (currentValue && currentValue !== value) {
this.setSelected(null, false)
}
// Close dropdown if input is clear or else open it
if (!this.openOnFocus || value) {
this.isActive = !!value
Expand Down

0 comments on commit 8e135e9

Please sign in to comment.