Skip to content

Commit

Permalink
fix(material/slider): fix cd for sliders w/ form controls (#27250)
Browse files Browse the repository at this point in the history
* fixes issue #27217

(cherry picked from commit d303ead)
  • Loading branch information
wagnermaciel committed Jun 12, 2023
1 parent b9871b1 commit feaaab9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/material/slider/slider-input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ export class MatSliderThumb implements _MatSliderThumb, OnDestroy, ControlValueA
this._updateThumbUIByValue();
this._slider._onValueChange(this);
this._cdr.detectChanges();
this._slider._cdr.markForCheck();
}
/** Event emitted when the `value` is changed. */
@Output() readonly valueChange: EventEmitter<number> = new EventEmitter<number>();
Expand Down
4 changes: 3 additions & 1 deletion src/material/slider/slider-interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/

import {InjectionToken} from '@angular/core';
import {InjectionToken, ChangeDetectorRef} from '@angular/core';
import {MatRipple, RippleGlobalOptions} from '@angular/material/core';

/**
Expand Down Expand Up @@ -153,6 +153,8 @@ export interface _MatSlider {

/** Used to set the transition duration for thumb and track animations. */
_setTransition: (withAnimation: boolean) => void;

_cdr: ChangeDetectorRef;
}

export interface _MatSliderThumb {
Expand Down

0 comments on commit feaaab9

Please sign in to comment.