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

Option to disable the keeping of focus after selection #1743

Open J-Michalek opened 1 year ago

J-Michalek commented 1 year ago

Is your feature request related to a problem? Please describe. We were used to the input loosing focus after an option was selected and would like to have a way to preserve the functionality.

Describe the solution you'd like I would like a prop being added that makes the behavior the same as before the changes made here.

Describe alternatives you've considered Functioning workaround:

<v-select
  ref="vSelect"
  @close="
    () => {
      $refs.vSelect?.$el.querySelector('input[type=search]')?.blur();
    }
  "
>
ipa1981 commented 1 year ago

While the workaround could be easier (below), I support the idea for a specific prop to keep the code more elegant:

<v-select @close="$el.querySelector('input[type=search]')?.blur()">