-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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(slide-toggle): disabled theme not working and dragging works if disabled #1268
fix(slide-toggle): disabled theme not working and dragging works if disabled #1268
Conversation
// accidentally. Manually prefixing here, because the un-prefixed property is not supported yet. | ||
-webkit-user-select: none; | ||
-moz-user-select: none; | ||
-ms-user-select: none; |
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.
Wouldn't autoprefixer do this?
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.
Seems like there is no autoprefixer anymore, and user-select
is also kind of a special property for the prefixer (e.g Material 1)
Huh, autoprefixer must have been accidentally omitted from the build change. How is |
I'm not really sure about it
Anything I should change / do? |
this._slideRenderer.startThumbDrag(this.checked); | ||
if (!this.disabled) { | ||
this._slideRenderer.startThumbDrag(this.checked); | ||
} |
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.
Test for this?
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 actually planned to add some gesture tests in another PR (because of big changes), but I will try to add them to this PR soon.
2d1911d
to
79ca54a
Compare
@jelbourn Added the tests for the dragging functionality. Please notice that I currently use the Gesture Config from the slider package. I would rather move this config to a more generic place in another PR, because this will bloat the Diff. |
* It seems like as per the new theming feature, view encapsulation turned off and now the checked theming overwrites the disabled theme (too high specificity) * If a slide-toggle is disabled, users are still able to drag the thumb (which is invalid) * Fix invalid `user-select` property, and now dragging works without clamps.
b6b0cd9
to
80a8c02
Compare
80a8c02
to
927f2b1
Compare
LGTM aside from some comment wording |
expect(slideThumbContainer.classList).toContain('md-dragging'); | ||
|
||
gestureConfig.emitEventForElement('slide', slideThumbContainer, { | ||
deltaX: 200 // Use a random number which will be clamped. |
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.
// Arbitrary, large delta that will be clamped to the end of the slide-toggle.
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.
Yeah, sounds better. Just changed it for all.
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. |
FYI: I'm trying to get some good HammerJS tests into the slide-toggle in the future.