Skip to content

Commit

Permalink
fix #3624 reset hovered autocomplete
Browse files Browse the repository at this point in the history
  • Loading branch information
jtommy committed Dec 30, 2021
1 parent 7d3bc87 commit be17dac
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/components/autocomplete/Autocomplete.vue
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,16 @@ export default {
this.setHovered(null)
}
})
} else {
if (this.hovered) {
// reset hovered if list doesn't contain it
const hoveredValue = this.getValue(this.hovered)
const data = this.computedData.map((d) => d.items)
.reduce((a, b) => ([...a, ...b]), [])
if (!data.some((d) => this.getValue(d) === hoveredValue)) {
this.setHovered(null)
}
}
}
}
},
Expand Down

0 comments on commit be17dac

Please sign in to comment.