sagalbot / vue-select

Everything you wish the HTML <select> element could do, wrapped up into a lightweight, extensible Vue component.
https://vue-select.org
MIT License
4.62k stars 1.33k forks source link

#1498: Add retainTextOnClick #1774

Open tjhaygood opened 1 year ago

tjhaygood commented 1 year ago

Adds "retainTextOnClick" option addressing issue #1498.

Please advise as to whether using a 0-second setTimeout is bad practice/unacceptable - in my testing it seemed to be the most reliable way to ensure that the "select" event fired last, which made the text being highlighted after clicking on the dropdown the most consistent. I also tried this.$nextTick() and using an event listener for click on the search input, using this.searchEl.select() in either of those didn't work consistently.