Skip to content
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,slide-toggle): wrong cursor #3821

Merged
merged 1 commit into from
Apr 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/lib/core/style/_vendor-prefixes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,9 @@
cursor: -webkit-grab;
cursor: grab;
}

@mixin cursor-grabbing {
cursor: -webkit-grabbing;
cursor: grabbing;
}
/* stylelint-enable */
4 changes: 3 additions & 1 deletion src/lib/slide-toggle/slide-toggle.scss
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ $mat-slide-toggle-bar-track-width: $mat-slide-toggle-bar-width - $mat-slide-togg

// Once the thumb container is being dragged around, we remove the transition duration to
// make the drag feeling fast and not delayed.
&.mat-dragging {
&.mat-dragging, &:active {
@include cursor-grabbing;

transition-duration: 0ms;
}
}
Expand Down
16 changes: 16 additions & 0 deletions src/lib/slider/slider.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@import '../core/style/variables';
@import '../core/style/vendor-prefixes';


// This refers to the thickness of the slider. On a horizontal slider this is the height, on a
Expand Down Expand Up @@ -97,7 +98,20 @@ $mat-slider-focus-ring-size: 30px !default;
}
}

%_mat-slider-cursor {
.mat-slider:not(.mat-slider-disabled) & {
@include cursor-grab;
}

.mat-slider:not(.mat-slider-disabled) &:active,
.mat-slider-sliding:not(.mat-slider-disabled) & {
@include cursor-grabbing;
}
}

.mat-slider-thumb {
@extend %_mat-slider-cursor;

position: absolute;
right: -$mat-slider-thumb-size / 2;
bottom: -$mat-slider-thumb-size / 2;
Expand All @@ -113,6 +127,8 @@ $mat-slider-focus-ring-size: 30px !default;
}

.mat-slider-thumb-label {
@extend %_mat-slider-cursor;

display: none;
align-items: center;
justify-content: center;
Expand Down