ask for reset and pick on option insert.

This commit is contained in:
Dongie Agnir 2015-10-23 13:16:52 -10:00
parent c070c7ad30
commit 663801ed79

View file

@ -197,6 +197,15 @@ impl VirtualMethods for HTMLOptionElement {
}
self.upcast::<Element>().check_parent_disabled_state_for_option();
let node = self.upcast::<Node>();
if self.Selected() {
if let Some(select) = node.ancestors()
.filter_map(Root::downcast::<HTMLSelectElement>)
.next() {
select.pick_option(self);
}
}
}
fn unbind_from_tree(&self, tree_in_doc: bool) {