Skip to content
New issue

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

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

Already on GitHub? # to your account

[md-select] Only one populates value #1389

Closed
zapping opened this issue Jan 10, 2018 · 9 comments · Fixed by #1447 or #1481
Closed

[md-select] Only one populates value #1389

zapping opened this issue Jan 10, 2018 · 9 comments · Fixed by #1447 or #1481
Labels

Comments

@zapping
Copy link
Contributor

zapping commented Jan 10, 2018

Can you please check this pen https://codepen.io/zapping/pen/RxMGZj ? If you click on the edit icon the corresponding md-select is supposed to show-up for edit.

For some reason the md-select shows value for only one component and the rest does not populate. I tried adding normal select also along and that seems to populate without issues.

@Samuell1
Copy link
Member

Samuell1 commented Jan 10, 2018

This is maybe same issue as #1262

@Samuell1 Samuell1 added the bug label Jan 12, 2018
@VdustR
Copy link
Member

VdustR commented Jan 16, 2018

<md-option v-for="option in options[key]">: component lists rendered with v-for should have explicit keys. See https://vuejs.org/guide/list.html#key for more info.

Works fine with keys.
https://codepen.io/VdustR/pen/QaVvVz

Check Vue.js guide

@zapping
Copy link
Contributor Author

zapping commented Jan 16, 2018

Thank you for looking into it. It does work with the keys set.

But actually what I have are different sets of select components in the form. As a short-cut to typing up different set of select components I had put them in a loop to generate a series of select components. In the same pen https://codepen.io/zapping/pen/RxMGZj the select components have been typed or entered separately. Unfortunately only one select component populates.

Sorry for the confusion.

@VdustR
Copy link
Member

VdustR commented Jan 16, 2018

As @Samuell1 said, the options of MdSelect is not reactive yet. We will look into it. Thanks for reporting.

@zapping
Copy link
Contributor Author

zapping commented Feb 2, 2018

Can you please check this again? The vue-material .js and .css have been set to version beta-8 but the issue still exists.

@Samuell1
Copy link
Member

Samuell1 commented Feb 2, 2018

@zapping can you please make reproduction in repository?

@zapping
Copy link
Contributor Author

zapping commented Feb 6, 2018

Sorry I didn't get you. The codepen for the issue was included before.

If it will help I have removed all the additional code and included just the necessary code in this pen https://codepen.io/zapping/pen/BYzMKY

@Samuell1
Copy link
Member

Samuell1 commented Feb 6, 2018

@zapping yeah i mean codepen sorry

@VdustR
Copy link
Member

VdustR commented Feb 6, 2018

v-model must be updated on the next tick after MdOptions updated which will update MdSelect.items, or MdSelect could not get the value / text pair for the new options.

https://codepen.io/VdustR/pen/jZrJzq

marcosmoura pushed a commit that referenced this issue Feb 6, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants