Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use multiselect as an input component as well as a select component #856

Open
el-duderino5 opened this issue Oct 15, 2018 · 4 comments
Open

Comments

@el-duderino5
Copy link

Is there anyway to use vue-multiselect to set the bound model of the component to whatever is being typed at any point in time, just like an HTML input? Basically, I would like to behave it as both a select component (as it does right now) and as input field which I can use to send to my backend in order to be persisted in a database. Pretty much like a form field and a select component at the same time.

@rublev
Copy link

rublev commented Oct 25, 2018

+1, if not for styling being consistent in my forms (vue-form-generator)

@SashaPonomarov
Copy link

I managed to achieve what you describe (combo box behavior) with vue-multiselect by listening both to input and search-change events, like this:

<multiselect :options="options" :value="field" 
  @input="setField($event)" @search-change="setField($event)"  
  :preserve-search="true" :show-no-results="false" :clear-on-select="false" />
setField(value) {
  this.field = value
}

@mickiii
Copy link

mickiii commented Nov 28, 2018

+1, would really love this feature! I need to retain whatever freetext is put into the input field and at the same time show clickable suggestions. When clicking I still what the value to be what the user searched, instead I will use the selection for other parts of my form.

@cheekudi
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants