1.1.3 (though I guess all versions)
Linux/Firefox 50.1.0 (though I guess all versions)
2.1.0 (though I guess all versions)
https://jsfiddle.net/8o1eqbd6/
Use an el-select element with multiple and filterable options combined.
If you start typing (let's say 'T') and then click on Two, that option gets selected, the input should be focused again and the text erased.
After you click on Two the input looses focus, you can't use backspace to erase, the text is still there and if you click outside the component or inside the input, the list disappears so you have to click again. It's annoying when you want to select multiple options (tags for a post in my case)
Fixed in https://github.com/ElemeFE/element/pull/2540/commits/8fc55e30e6ef2611e5a54df6488db4856e7943c1
Now after selecting an option, the input regains focus. But the text is not erased because in some cases you may need to select more than one options for the same query.
Thanks! Not a fan of the text decision but it's ok. Great work BTW.
En Taro Tassadar!
@Leopoldthecoder
could that behaviour be optional to erase the query text?
or how can i force it to erase the query text?
@anotheri how did you solve this problem?
@allfreelancers
your html (or jade, like in my case) template should contain ref attribute as well as use listener on @change event, like this:
el-select(
ref="participants",
v-model="form.participants",
multiple,
filterable,
:default-first-option='true',
@change='onChangeParticipants'
)
el-option(
v-for="person in people",
:key="person.id",
:value="person.id",
:label="person.name"
)
and you need to define that listener function like this in your js code:
onChangeParticipants ( e, data ) {
this.$refs.participants.query = '';
},
@anotheri Thank you so much!
In version 2.0 we'll have a new prop reserve-keyword. When set to false, the query text will be cleared after selecting an option.
A W E S O M E
@Leopoldthecoder I cant reserve-keyword found in
http://element.eleme.io/2.0/#/en-US/component/select
@allfreelancers I just released 2.0.0-beta.1. Guess you can find it now.
@Leopoldthecoder Thank you so much!
This issue is still there in "element-ui": "^2.9.1". I am not able to filter if I pass multiple as a prop as well. I am not able to focus on the input itself if I pass multiple.
Most helpful comment
@allfreelancers
your html (or jade, like in my case) template should contain
refattribute as well as use listener on@changeevent, like this:and you need to define that listener function like this in your js code: