This repository was archived by the owner on Apr 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27.4k
fix(select): revert commit to fix skipping over blank disabled options #8221
Closed
+97
−21
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
bfdaa24
revert(select): avoid checking option element selected properties in …
fb2e5a4
test(select): add test against updating selected property on digest w…
b7a2cc5
test(select): add test cases for selects with blank disabled options
e4995f4
test(select): add test of updating the model because of ng-change
03b518c
test(select): add extra expectations and comments for clarity
petebacondarwin 6140861
fix(select): do not update selected property of an option element on …
petebacondarwin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Does this mean that you can conceivably render() multiple times per digest (not including retrying dirtychecking)?
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.
Well previously
render()
was being called a minimum of 2 times for every digest, whether or not there was a change to any of the model values.I initially put these into a
watchGroup()
call but that doesn't have a parameter to watch deeply.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.
but we shouldn't really need deep watching afaik? since we only test if values are the same with identity equality anyhow
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.
or is something different now that we do need to do that
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.
The deep watches are needed because we need to re-render if the list of options changes (
valuesFn
).Also, the
selectedSet
is recreated every time and so we need to check whether its properties have changed.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.
I'm not really sold on that approach.
Previously, we were doing this work in the watch expression, and knew specifically which options changed and how.
Now, we're deep-watching with the same watch action twice, without knowing what's changed and what hasn't. For small collections of options it won' t matter, so if we're shipping this, really emphasize that it's not intended for large collections or complex collections of options