Vue-material: Changes to v-model not being reflected in multi-select

Created on 28 Feb 2017  路  4Comments  路  Source: vuematerial/vue-material

Steps to reproduce

  1. Navigate to this codepen
  2. Wait the two seconds for the setTimeout to pop the two, pre-existing selections
  3. Select "User 2" by clicking on the multi-select with your mouse

Which browser?

Chrome 56

What is expected?

"User 2" should be the only user showing

What is actually happening?

The select is showing "User 1, User 2, User 3"

Reproduction Link

http://codepen.io/adam-hanna/pen/wJKBav

bug duplicated

All 4 comments

Hi, @adam-hanna
User 1, User 2, User 3 is shown because it cached in multipleOptions variable.
So, do display properly just clear it, like this this.$refs.multiselect.multipleOptions = {}
There multiselect is _ref_ to mdSelect
link

That did it, thanks!

Still seems a bit hacky, though. I would have expected it to match exactly the v-model, no?

Still seems a bit hacky, though. I would have expected it to match exactly the v-model, no?

Yep, as i see, in setTextAndValue, which handle v-model changes, no proper handler for multiple values.
I think, there is should be a check that mdSelect handle multiple values. May be somethind linke this

if (this.multiple) {
  this.multipleOptions = output.value
}

I fix it via PR #749 .
Soon you'll have the bug fix @adam-hanna !

Thank you guys for opening this issue. :D

Was this page helpful?
0 / 5 - 0 ratings

Related issues

diverted247 picture diverted247  路  3Comments

Leshgan picture Leshgan  路  3Comments

sergey-koretsky picture sergey-koretsky  路  3Comments

korylprince picture korylprince  路  3Comments

xinzhanguo picture xinzhanguo  路  3Comments