fix(runtime-dom/v-model): only set selectedIndex when the value changes (#3845)
This commit is contained in:
parent
8b94464a3b
commit
ecd97ee6e4
@ -224,12 +224,12 @@ function setSelected(el: HTMLSelectElement, value: any) {
|
||||
}
|
||||
} else {
|
||||
if (looseEqual(getValue(option), value)) {
|
||||
el.selectedIndex = i
|
||||
if (el.selectedIndex !== i) el.selectedIndex = i
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!isMultiple) {
|
||||
if (!isMultiple && el.selectedIndex !== -1) {
|
||||
el.selectedIndex = -1
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user