Vue-multiselect: Placeholder not showing up

Created on 20 Mar 2017  路  5Comments  路  Source: shentao/vue-multiselect

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

bug

Most helpful comment

Hi @shentao, I'm using [email protected] and encountered that :searchable="false" makes placeholder not showing.

All 5 comments

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]

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hskrishna29 picture hskrishna29  路  3Comments

Uninen picture Uninen  路  4Comments

wujekbogdan picture wujekbogdan  路  4Comments

zachleigh picture zachleigh  路  3Comments

dmitov picture dmitov  路  4Comments