Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Multiple Select Initialization #3199

Closed
knerok opened this issue Feb 8, 2021 · 4 comments · Fixed by #3202
Closed

Multiple Select Initialization #3199

knerok opened this issue Feb 8, 2021 · 4 comments · Fixed by #3202
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. has workaround A workaround has been found to avoid the problem 🐞 bug Something isn't working

Comments

@knerok
Copy link

knerok commented Feb 8, 2021

Version

3.0.5

Reproduction link

https://codesandbox.io/s/modest-cannon-7qoku?file=/src/App.vue

Steps to reproduce

  1. Create select with few different options.
  2. Add 'multiple' attr to select.
  3. Add 'selected' attr to few select options.
  4. Just update the page

What is expected?

All selected options are chosen

What is actually happening?

Only last select option is chosen

@HcySunYang HcySunYang added 🐞 bug Something isn't working ❗ p4-important Priority 4: this fixes bugs that violate documented behavior, or significantly improves perf. and removed 🐞 bug Something isn't working ❗ p4-important Priority 4: this fixes bugs that violate documented behavior, or significantly improves perf. labels Feb 9, 2021
@HcySunYang
Copy link
Member

You can use v-model until this gets fixed, https://codesandbox.io/s/angry-sound-ljjte?file=/src/App.vue

@HcySunYang HcySunYang added has workaround A workaround has been found to avoid the problem 🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. and removed ❗ p4-important Priority 4: this fixes bugs that violate documented behavior, or significantly improves perf. labels Feb 9, 2021
@knerok
Copy link
Author

knerok commented Feb 9, 2021

@HcySunYang Thank you! But unfortunately we need described behavoure. We have pretty big app with tons of legacy code, so then we mount vue into our main wrapper, it breaks all <select multiple > everywhere in the legacy part

@knerok
Copy link
Author

knerok commented Feb 9, 2021

And we did not have this problem with vue 2

@HcySunYang
Copy link
Member

The children are patched before props, which is necessary for <select value>, but the opposite is true for <select multiple>. In vue2, we take that as a special case https://github.com/vuejs/vue/blob/dev/src/platforms/web/runtime/node-ops.js#L7-L13, and this PR(#3202) respects this behavior

yyx990803 pushed a commit that referenced this issue Mar 25, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Oct 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. has workaround A workaround has been found to avoid the problem 🐞 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants