Index: lib/html/dart2js/html_dart2js.dart |
diff --git a/lib/html/dart2js/html_dart2js.dart b/lib/html/dart2js/html_dart2js.dart |
index a45552121903f98df7f7ca96a28a95ed5e91da7e..b6d8a84e35c9b8d5665379c29fe65b39ea79c064 100644 |
--- a/lib/html/dart2js/html_dart2js.dart |
+++ b/lib/html/dart2js/html_dart2js.dart |
@@ -31235,8 +31235,6 @@ class _SelectElementImpl extends _ElementImpl implements SelectElement native "* |
String name; |
- final _HTMLOptionsCollectionImpl options; |
- |
bool required; |
int selectedIndex; |
@@ -31262,8 +31260,19 @@ class _SelectElementImpl extends _ElementImpl implements SelectElement native "* |
void setCustomValidity(String error) native; |
+ // Override default options, since IE returns SelectElement itself and it |
+ // does not operate as a List. |
+ List<OptionElement> get options() { |
+ return this.elements.filter((e) => e is OptionElement); |
+ } |
+ |
List<OptionElement> get selectedOptions() { |
- return this.options.filter((o) => o.selected); |
+ // IE does not change the selected flag for single-selection items. |
+ if (this.multiple) { |
+ return this.options.filter((o) => o.selected); |
+ } else { |
+ return [this.options[this.selectedIndex]]; |
+ } |
} |
} |
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |