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> {
498498 } else {
499499 this . setValue ( value ) ;
500500 }
501+
502+ this . adapter . emitChangeEvent (
503+ thumb === Thumb . START ? this . valueStart : this . value , thumb ) ;
501504 }
502505
503506 /** Shows value indicator on thumb(s). */
Original file line number Diff line number Diff line change @@ -1206,6 +1206,23 @@ describe('MDCSliderFoundation', () => {
12061206 expect ( mockAdapter . emitChangeEvent ) . toHaveBeenCalledWith ( 77 , Thumb . END ) ;
12071207 } ) ;
12081208
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+
12091226 it ( 'fires `dragStart`/`dragEnd` events across drag interaction' , ( ) => {
12101227 const { foundation, mockAdapter} = setUpAndInit ( {
12111228 valueStart : 20 ,
You can’t perform that action at this time.
0 commit comments