Skip to content

Commit 6c4a1f7

Browse files
committed
fix(material/slider): value jumping after drag with box-sizing: border-box (#26345)
It's common for apps to set `box-sizing: border-box` on all elements to make layouts more consistent, however this ended up offsetting the native slider inside `mat-slider` which was causing the value to jump after dragging and the 100% value to happen around the 95% mark. Fixes #26246. (cherry picked from commit 6f393ff)
1 parent fb4f61f commit 6c4a1f7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/material/slider/slider.scss

+3
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ $mat-slider-horizontal-margin: 8px !default;
3434
-webkit-tap-highlight-color: transparent;
3535

3636
.mdc-slider__input {
37+
// It's common for apps to globally set `box-sizing: border-box` which messes up our
38+
// measurements. Explicitly set `content-box` to avoid issues like #26246.
39+
box-sizing: content-box;
3740
pointer-events: auto;
3841

3942
&.mat-mdc-slider-input-no-pointer-events {

0 commit comments

Comments
 (0)