-
Notifications
You must be signed in to change notification settings - Fork 3.4k
fix(slider): fixed incorrect update of model and min/max values in same digest cycle #10980
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
I signed it! |
CLAs look good, thanks! |
Thank you for your contribution! Please update your commit message to follow the commit message guidelines. This is important for your changes to properly show up in the changelog. For the last line, |
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.
Functionally, this looks very good. I just had some questions about the last describe block and saw a few missing semicolons. The only other thing was the commit message needing to be updated. When you make the changes, please make sure to squash your commits and then force push your changes to the same branch (sviams:master
in this case).
src/components/slider/slider.spec.js
Outdated
var slider = null; | ||
|
||
beforeEach(function() { | ||
slider = setup('min="0" max="{{max}}" ng-model="model"') |
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.
Please add semicolon at the end.
src/components/slider/slider.spec.js
Outdated
var slider = null; | ||
|
||
beforeEach(function() { | ||
slider = setup('min="0" max="{{max}}" ng-model="model"') |
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.
Please add semicolon at the end.
src/components/slider/slider.spec.js
Outdated
var slider = null; | ||
|
||
beforeEach(function() { | ||
slider = setup('min="{{min}}" max="10" ng-model="model"') |
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.
Please add semicolon at the end.
src/components/slider/slider.spec.js
Outdated
var slider = null; | ||
|
||
beforeEach(function() { | ||
slider = setup('min="{{min}}" max="10" ng-model="model"') |
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.
Please add semicolon at the end.
src/components/slider/slider.spec.js
Outdated
pageScope.$apply(); | ||
expect(slider.attr('aria-valuenow')).toEqual('6'); | ||
expect(slider.attr('aria-valuemin')).toEqual('5'); | ||
pageScope.model = 5; |
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.
This seems to be checking "when updating min and model value equal to previous min simultaneously" rather than "when updating min and model value above previous min simultaneously". Since the previous min was 5
and the new model value is 5
. Am I reading this wrong? Was this intended?
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 agree, this was not entirely clear so I updated both the title and expectations of the test to better match the intention.
Oh and one more thing, sorry for taking so long to get to reviewing this PR. |
…igest cycle Fix out of sync state between model and view value that occurs in Slider when both model and either min and/or max values are updated within the same digest cycle. This is due to the $ngModelCtrl formatters kicking in and validating the view value before the Slider directive $observer on the min and max attributes can fire. Fixes angular#9125
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.
LGTM
Thanks for the quick turnaround! Sending to presubmit testing now. |
…igest cycle (angular#10980) Fix out of sync state between model and view value that occurs in Slider when both model and either min and/or max values are updated within the same digest cycle. This is due to the $ngModelCtrl formatters kicking in and validating the view value before the Slider directive $observer on the min and max attributes can fire. Fixes angular#9125
…igest cycle (#10980) Fix out of sync state between model and view value that occurs in Slider when both model and either min and/or max values are updated within the same digest cycle. This is due to the $ngModelCtrl formatters kicking in and validating the view value before the Slider directive $observer on the min and max attributes can fire. Fixes #9125
Implemented check for out of sync state between model and view value in Slider, which occurred when both model and either min and/or max values were updated within the same digest cycle. This is due to the $ngModelCtrl formatters kicking in and validating the view value before the Slider directive $observer on the min and max attributes could fire.
Fixes #9125