You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
v-model on <select multiple> uses stale collection type after switching between Array and Set #15009
Switching back from Set -> Array shows the same stale-type behavior in reverse.
What is expected?
The current collection type should be respected after the model switches at runtime.
What is actually happening?
The change handler keeps using the collection type captured when the directive was created, so the first user interaction after a runtime Array/Set switch emits the old type.
From vModelSelect.created, isSetModel is captured once from the initial binding value and then reused by the change listener. A tiny regression test could mount with an Array, update the model to a Set, trigger change, and assert the emitted value is still a Set; that should fail before moving the type check into the listener.
Thank @barry166 ! The added regression test follows this path, it mounts with an Array, updates the model to a Set, triggers change, and asserts the value remains a Set.
I also kept a small follow-up assertion for switching back to Array, but the main failing regression case is the Array -> Set path you described.
Activity
barry166 commentedon Jun 28, 2026
From
vModelSelect.created,isSetModelis captured once from the initial binding value and then reused by thechangelistener. A tiny regression test could mount with an Array, update the model to aSet, triggerchange, and assert the emitted value is still aSet; that should fail before moving the type check into the listener.zongxi1115 commentedon Jun 28, 2026
Thank @barry166 ! The added regression test follows this path, it mounts with an Array, updates the model to a Set, triggers change, and asserts the value remains a Set.
I also kept a small follow-up assertion for switching back to Array, but the main failing regression case is the Array -> Set path you described.
fix(runtime-dom): respect current select model type (#15010)