This repository was archived by the owner on Jan 13, 2025. It is now read-only.
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 @@ -498,6 +498,9 @@ export class MDCSliderFoundation extends MDCFoundation<MDCSliderAdapter> {
498
498
} else {
499
499
this . setValue ( value ) ;
500
500
}
501
+
502
+ this . adapter . emitChangeEvent (
503
+ thumb === Thumb . START ? this . valueStart : this . value , thumb ) ;
501
504
}
502
505
503
506
/** Shows value indicator on thumb(s). */
Original file line number Diff line number Diff line change @@ -1206,6 +1206,23 @@ describe('MDCSliderFoundation', () => {
1206
1206
expect ( mockAdapter . emitChangeEvent ) . toHaveBeenCalledWith ( 77 , Thumb . END ) ;
1207
1207
} ) ;
1208
1208
1209
+ it ( 'fires `change` event on input change' , ( ) => {
1210
+ const { foundation, mockAdapter} = setUpAndInit ( {
1211
+ valueStart : 20 ,
1212
+ value : 50 ,
1213
+ isRange : true ,
1214
+ isDiscrete : true ,
1215
+ } ) ;
1216
+
1217
+ mockAdapter . getInputValue . withArgs ( Thumb . START ) . and . returnValue ( 5 ) ;
1218
+ foundation . handleInputChange ( Thumb . START ) ;
1219
+ expect ( mockAdapter . emitChangeEvent ) . toHaveBeenCalledWith ( 5 , Thumb . START ) ;
1220
+
1221
+ mockAdapter . getInputValue . withArgs ( Thumb . END ) . and . returnValue ( 60 ) ;
1222
+ foundation . handleInputChange ( Thumb . END ) ;
1223
+ expect ( mockAdapter . emitChangeEvent ) . toHaveBeenCalledWith ( 60 , Thumb . END ) ;
1224
+ } ) ;
1225
+
1209
1226
it ( 'fires `dragStart`/`dragEnd` events across drag interaction' , ( ) => {
1210
1227
const { foundation, mockAdapter} = setUpAndInit ( {
1211
1228
valueStart : 20 ,
You can’t perform that action at this time.
0 commit comments