Skip to content

Commit 855cf1c

Browse files
committed
fix(ngOptions): fix frozen ui in ie with more than one select[multiple]
If there is more than one select next to each other, and the first select is wrappend in an element with display: inline or display: inline-block, all but the last select are completely unresponsive to any user input. This cannot be tested in a unit-test or e2e test. Closes angular#11314 Closes angular#11795
1 parent e1f4f23 commit 855cf1c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/ng/directive/ngOptions.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -576,11 +576,16 @@ var ngOptionsDirective = ['$compile', '$parse', function($compile, $parse) {
576576
function updateOptionElement(option, element) {
577577
option.element = element;
578578
element.disabled = option.disabled;
579-
if (option.value !== element.value) element.value = option.selectValue;
579+
// NOTE: The label must be set before the value, otherwise IE10/11/EDGE create unresponsive
580+
// selects in certain circumstances when multiple selects are next to each other and display
581+
// the option list in listbox style, i.e. the select is [multiple], or specifies a [size].
582+
// See https://github.com/angular/angular.js/issues/11314 for more info.
583+
// This is unfortunately untestable with unit / e2e tests
580584
if (option.label !== element.label) {
581585
element.label = option.label;
582586
element.textContent = option.label;
583587
}
588+
if (option.value !== element.value) element.value = option.selectValue;
584589
}
585590

586591
function addOrReuseElement(parent, current, type, templateElement) {

0 commit comments

Comments
 (0)