File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -313,6 +313,10 @@ $fallbacks: m3-slider.get-tokens();
313
313
& .mdc-slider--disabled {
314
314
cursor : auto ;
315
315
opacity : 0.38 ;
316
+
317
+ .mdc-slider__input {
318
+ cursor : auto ;
319
+ }
316
320
}
317
321
318
322
.mdc-slider__thumb ,
Original file line number Diff line number Diff line change @@ -563,6 +563,22 @@ describe('MatSlider', () => {
563
563
it ( 'should set the disabled attribute on the input element' , ( ) => {
564
564
expect ( input . _hostElement . disabled ) . toBeTrue ( ) ;
565
565
} ) ;
566
+
567
+ it ( 'should have "auto" cursor on thumb input when slider is disabled' , ( ) => {
568
+ // The beforeEach already creates a DisabledSlider component fixture and detects changes.
569
+ // We can directly access `input` (MatSliderThumb) and its `_hostElement`.
570
+ // The slider is disabled by default in this setup.
571
+ // fixture.detectChanges() might be needed if there were any dynamic changes
572
+ // but here we are checking the initial state of a disabled slider.
573
+ // However, calling it ensures the component is stable and styles are applied.
574
+ const fixture = TestBed . createComponent ( DisabledSlider ) ;
575
+ fixture . detectChanges ( ) ;
576
+ const sliderDebugElement = fixture . debugElement . query ( By . directive ( MatSlider ) ) ;
577
+ const slider = sliderDebugElement . componentInstance ;
578
+ const inputThumb = slider . _getInput ( _MatThumb . END ) as MatSliderThumb ;
579
+ const thumbInputElement = inputThumb . _hostElement ;
580
+ expect ( getComputedStyle ( thumbInputElement ) . cursor ) . toBe ( 'auto' ) ;
581
+ } ) ;
566
582
} ) ;
567
583
568
584
describe ( 'disabled range slider' , ( ) => {
You can’t perform that action at this time.
0 commit comments