blob: 0f378abaf9a3e62a6d2f3e1365d69b92e8580859 [file] [log] [blame]
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
part of $LIBRARYNAME;
$(ANNOTATIONS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
$!MEMBERS
// Override default options, since IE returns SelectElement itself and it
// does not operate as a List.
List<OptionElement> get options {
var options = this.children.where((e) => e is OptionElement).toList();
// TODO(floitsch): find better way to create a read-only list view.
return options.take(options.length);
}
List<OptionElement> get selectedOptions {
// IE does not change the selected flag for single-selection items.
if (this.multiple) {
var options = this.options.where((o) => o.selected).toList();
// TODO(floitsch): find better way to create a read-only list view.
return options.take(options.length);
} else {
return [this.options[this.selectedIndex]];
}
}
}