-
Notifications
You must be signed in to change notification settings - Fork 6.8k
fix(slider): slider emiting changes on slide end when disabled #9434
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(slider): slider emiting changes on slide end when disabled #9434
Conversation
src/lib/slider/slider.ts
Outdated
@@ -518,7 +518,7 @@ export class MatSlider extends _MatSliderMixinBase | |||
_onSlideEnd() { | |||
this._isSliding = false; | |||
|
|||
if (this._valueOnSlideStart != this.value) { | |||
if (this._valueOnSlideStart != null && this._valueOnSlideStart != this.value) { |
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 don't think this is quite right, how about: this._valueOnSlideStart != this.value && !this.disabled
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.
Yes, maybe is better, I am not in context at all. I will make the change (Y)
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 have made the change @mmalerba
1549883
to
7ed6b37
Compare
Got a minor lint error:
|
This passes google presubmit @llorenspujol we can merge this if you correct the lint error |
Currently the slider is firing a change event on slideEnd when it is disabled. If it is disabled and the value of the slider doesn't change, it shouldn't have to emit any change event.
7ed6b37
to
0d1fbe2
Compare
@jelbourn @andrewseguin lint fixed. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Currently, the slider is firing a change event on slideEnd when it is disabled. If it is disabled and the value of the slider doesn't change, it shouldn't have to emit any change event.
I have added the test and its corresponding fix for it to pass.