forked from angular/angular.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ng:options): select correct element when '?'-option was previousl…
…y selected Closes angular#599
- Loading branch information
Showing
1 changed file
with
1 addition
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 comment
on commit fec16a4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome! but we'll need a test for this stuff so that we don't reintroduce it again. can you add that? it should be as simple as constructing a select element and options model, making sure that the selected model is undefined, then selecting an option element with browserTrigger(optionElement) and asserting that the right option element has the selected property.
existingOption
was taken from cache (optionGroupsCache
). When user switches selection to something else, theexistingOption.element.selected
is changed, butexistingOption.selected
is not.It worked well if there was no '?' element in
optionGroups
(added on line 343). When added, it causedexistingOptions
andoptionGroups
to grow. When user switched from '?' to something else, theoptionGroups
was shrinked by 1 element, butexistingOptions
was not. The compiler started replacing labels and ids in<option>
tags, but the selection was not updated.Jeez. This commit was like 8 symbols, but the explanation and debugging took sooo long :)