@@ -259,7 +259,10 @@ export class MdcChip implements AfterViewInit, OnDestroy {
259
259
}
260
260
} ,
261
261
eventTargetHasClass : ( target : HTMLElement , className : string ) => target . classList . contains ( className ) ,
262
- notifyInteraction : ( ) => this . _emitSelectionChangeEvent ( ) ,
262
+ notifyInteraction : ( ) => {
263
+ this . selected = ! this . selected ;
264
+ this . _emitSelectionChangeEvent ( ) ;
265
+ } ,
263
266
notifyTrailingIconInteraction : ( ) => this . trailingIconInteraction . emit ( { detail : { chipId : this . id } } ) ,
264
267
notifyRemoval : ( ) => this . removed . emit ( { detail : { chipId : this . id , root : this } } ) ,
265
268
getComputedStyleValue : ( propertyName : string ) => {
@@ -277,7 +280,7 @@ export class MdcChip implements AfterViewInit, OnDestroy {
277
280
beginExit ( ) : void ,
278
281
setSelected ( selected : boolean ) : void ,
279
282
setShouldRemoveOnTrailingIconClick ( shouldRemove : boolean ) : void ,
280
- handleInteraction ( evt : Event ) : void ,
283
+ handleInteraction ( evt : KeyboardEvent | MouseEvent ) : void ,
281
284
handleTransitionEnd ( evt : TransitionEvent ) : void ,
282
285
handleTrailingIconInteraction ( evt : Event ) : void
283
286
} = new MDCChipFoundation ( this . createAdapter ( ) ) ;
@@ -319,8 +322,7 @@ export class MdcChip implements AfterViewInit, OnDestroy {
319
322
320
323
private _loadListeners ( ) : void {
321
324
this . _chipInteractionEventSubscription = this . chipInteractionEvents . pipe ( )
322
- . subscribe ( evt => {
323
- this . selected = ! this . selected ;
325
+ . subscribe ( ( evt : KeyboardEvent | MouseEvent ) => {
324
326
this . _foundation . handleInteraction ( evt ) ;
325
327
} ) ;
326
328
0 commit comments