Skip to content

Commit d303ead

Browse files
authored
fix(material/slider): fix cd for sliders w/ form controls (#27250)
* fixes issue #27217
1 parent de7c3db commit d303ead

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/material/slider/slider-input.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ export class MatSliderThumb implements _MatSliderThumb, OnDestroy, ControlValueA
102102
this._updateThumbUIByValue();
103103
this._slider._onValueChange(this);
104104
this._cdr.detectChanges();
105+
this._slider._cdr.markForCheck();
105106
}
106107
/** Event emitted when the `value` is changed. */
107108
@Output() readonly valueChange: EventEmitter<number> = new EventEmitter<number>();

src/material/slider/slider-interface.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import {InjectionToken} from '@angular/core';
9+
import {InjectionToken, ChangeDetectorRef} from '@angular/core';
1010
import {MatRipple, RippleGlobalOptions} from '@angular/material/core';
1111

1212
/**
@@ -153,6 +153,8 @@ export interface _MatSlider {
153153

154154
/** Used to set the transition duration for thumb and track animations. */
155155
_setTransition: (withAnimation: boolean) => void;
156+
157+
_cdr: ChangeDetectorRef;
156158
}
157159

158160
export interface _MatSliderThumb {

0 commit comments

Comments
 (0)