Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 5fe113f

Browse files
committed
fix ie9
1 parent 1bd55d9 commit 5fe113f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/ng/directive/ngOptions.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -472,10 +472,16 @@ var ngOptionsDirective = ['$compile', '$document', '$parse', function($compile,
472472

473473
// Make sure to remove the selected attribute from the previously selected option
474474
// Otherwise, screen readers might get confused
475-
if (selectedOption) selectedOption.element.removeAttribute('selected');
475+
if (selectedOption) {
476+
selectedOption.element.removeAttribute('selected');
477+
selectedOption.element.selected = false; // IE9
478+
}
476479

477480
if (option) {
478-
if (providedEmptyOption) emptyOption.removeAttr('selected');
481+
if (providedEmptyOption) {
482+
emptyOption.removeAttr('selected');
483+
emptyOption.prop('selected', false); // IE9
484+
}
479485
// Don't update the option when it is already selected.
480486
// For example, the browser will select the first option by default. In that case,
481487
// most properties are set automatically - except the `selected` attribute, which we

0 commit comments

Comments
 (0)