Skip to content

Commit

Permalink
ask for reset and pick on option insert.
Browse files Browse the repository at this point in the history
  • Loading branch information
dagnir committed Oct 23, 2015
1 parent c070c7a commit 663801e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions components/script/dom/htmloptionelement.rs
Expand Up @@ -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) {
Expand Down

0 comments on commit 663801e

Please sign in to comment.