File tree Expand file tree Collapse file tree 2 files changed +6
-11
lines changed
tools/public_api_guard/material Expand file tree Collapse file tree 2 files changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -190,11 +190,6 @@ export class MatSlider extends _MatSliderMixinBase
190
190
get min ( ) : number { return this . _min ; }
191
191
set min ( v : number ) {
192
192
this . _min = coerceNumberProperty ( v , this . _min ) ;
193
-
194
- // If the value wasn't explicitly set by the user, set it to the min.
195
- if ( this . _value === null ) {
196
- this . value = this . _min ;
197
- }
198
193
this . _percent = this . _calculatePercentage ( this . _value ) ;
199
194
200
195
// Since this also modifies the percentage, we need to let the change detection know.
@@ -242,16 +237,16 @@ export class MatSlider extends _MatSliderMixinBase
242
237
243
238
/** Value of the slider. */
244
239
@Input ( )
245
- get value ( ) : number | null {
240
+ get value ( ) : number {
246
241
// If the value needs to be read and it is still uninitialized, initialize it to the min.
247
242
if ( this . _value === null ) {
248
243
this . value = this . _min ;
249
244
}
250
- return this . _value ;
245
+ return this . _value as number ;
251
246
}
252
- set value ( v : number | null ) {
247
+ set value ( v : number ) {
253
248
if ( v !== this . _value ) {
254
- let value = coerceNumberProperty ( v ) ;
249
+ let value = coerceNumberProperty ( v , 0 ) ;
255
250
256
251
// While incrementing by a decimal we can end up with values like 33.300000000000004.
257
252
// Truncate it to ensure that it matches the label and to make it easier to work with.
Original file line number Diff line number Diff line change @@ -23,8 +23,8 @@ export declare class MatSlider extends _MatSliderMixinBase implements ControlVal
23
23
set thumbLabel ( value : boolean ) ;
24
24
get tickInterval ( ) : 'auto' | number ;
25
25
set tickInterval ( value : 'auto' | number ) ;
26
- get value ( ) : number | null ;
27
- set value ( v : number | null ) ;
26
+ get value ( ) : number ;
27
+ set value ( v : number ) ;
28
28
readonly valueChange : EventEmitter < number | null > ;
29
29
valueText : string ;
30
30
get vertical ( ) : boolean ;
You can’t perform that action at this time.
0 commit comments