Version 2.0-beta.15
Hi. I have this config :
<multiselect :options="genders"
:searchable="false"
:close-on-select="true"
:multiple="false"
:allow-empty="false"
:value="value"
@input="updateValue"
placeholder="Select option"
deselect-label="Can't unselect"
></multiselect>
the placeholder that shows up is [] not really a placeholder as it is an empty array. From what I've seen it has something to do with this line :
currentOptionLabel () {
return this.multiple
? this.searchable ? '' : this.placeholder
: this.internalValue[0].length
? this.getOptionLabel(this.internalValue[0])
: this.searchable ? '' : this.placeholder
}
and this line
internalValue: this.value || this.value === 0
? deepClone(Array.isArray(this.value) ? this.value : [this.value])
: []
Changing searchable to true.. shows up the placeholder
Sounds like a bug! Thanks for finding it. :)
glad i found it so it can be fixed. :) i.am using this component in my project so if i find anything else i.ll let you know.
Seems to be working fine.
https://jsfiddle.net/qfc0d5co/
Hi @shentao, I'm using [email protected] and encountered that :searchable="false" makes placeholder not showing.
@shentao
This seems to be happening for > [email protected]
See https://jsfiddle.net/gerritgiliomee1/1Lwwg6f0/ and note the version that was changed to [email protected]
Most helpful comment
Hi @shentao, I'm using
[email protected]and encountered that:searchable="false"makes placeholder not showing.