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
fix(ngOptions): do not unset the selected property unless necessary
Previously, when updating the value of a `select[multiple]` element, all options
were first set to `selected = false` and then the selected ones where set to
`true`. By setting an already selected option to `selected = false` and then
`true` again - essentially unselecting and reselecting it - caused some browsers
(including Firefox, IE and (under some circumstances) Chrome) to scroll to
unexpectedly scroll to the last selected option.
This commit fixes it by ensuring that the `selected` property is set to its
final value and only if that value is different than the previous one, thus
avoiding the undesirable behavior.
Fixesangular#15477
0 commit comments