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

3.4.15 regression on v-model in <select> #10194

Closed
jacekkow opened this issue Jan 23, 2024 · 2 comments · Fixed by #10200
Closed

3.4.15 regression on v-model in <select> #10194

jacekkow opened this issue Jan 23, 2024 · 2 comments · Fixed by #10200

Comments

@jacekkow
Copy link

jacekkow commented Jan 23, 2024

Vue version

3.4.15

Link to minimal reproduction

https://gist.github.com/jacekkow/9a494e92ca45d16907d2a2514e8422c2

Steps to reproduce

Click on "First (click)" and/or "Second (click)".

What is expected?

<option> tags within <select> have the "selected" flag set. This happens when downgrading to Vue 3.4.14.

What is actually happening?

<option> within <select> does not have the "selected" flag set.

System Info

No response

Any additional comments?

No response

@LinusBorg
Copy link
Member

LinusBorg commented Jan 23, 2024

Cuplrit:

// fast path for updates triggered by other changes
if (isArrayValue && looseEqual(value, oldValue)) {
return
}

value and oldValue are the same array. So that fastpath doesn't work on mutations to the select array. It doesn't cause a problem when selecting an item in the select itself because then we skip the that part of the code.

Introduced by 2ffb956

a workaround until a fix would be to use an immutable array.

But the question is if/how we can keep the fastpath goal of that commit while supporting mutating the array, which is kind of a common thing to do and should of course work.

@Doctor-wu
Copy link
Contributor

Doctor-wu commented Jan 24, 2024

reproduction in playground

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants