@@ -796,36 +796,37 @@ export class McTagList extends McTagListMixinBase implements McFormFieldControl<
796796
797797 /** Listens to user-generated selection events on each tag. */
798798 private listenToTagsFocus ( ) : void {
799- this . tagFocusSubscription = this . tagFocusChanges . subscribe ( ( event ) => {
800- const tagIndex : number = this . tags . toArray ( ) . indexOf ( event . tag ) ;
799+ this . tagFocusSubscription = this . tagFocusChanges
800+ . subscribe ( ( event ) => {
801+ const tagIndex : number = this . tags . toArray ( ) . indexOf ( event . tag ) ;
801802
802- if ( this . isValidIndex ( tagIndex ) ) {
803- this . keyManager . updateActiveItem ( tagIndex ) ;
804- }
803+ if ( this . isValidIndex ( tagIndex ) ) {
804+ this . keyManager . updateActiveItem ( tagIndex ) ;
805+ }
805806
806- this . stateChanges . next ( ) ;
807- } ) ;
807+ this . stateChanges . next ( ) ;
808+ } ) ;
808809
809- this . tagBlurSubscription = this . tagBlurChanges . subscribe ( ( ) => {
810- this . blur ( ) ;
811- this . stateChanges . next ( ) ;
812- } ) ;
810+ this . tagBlurSubscription = this . tagBlurChanges
811+ . subscribe ( ( ) => {
812+ this . blur ( ) ;
813+ this . stateChanges . next ( ) ;
814+ } ) ;
813815 }
814816
815817 private listenToTagsRemoved ( ) : void {
816- this . tagRemoveSubscription = this . tagRemoveChanges . subscribe ( ( event ) => {
817- const tag = event . tag ;
818- const tagIndex = this . tags . toArray ( ) . indexOf ( event . tag ) ;
819-
820- // In case the tag that will be removed is currently focused, we temporarily store
821- // the index in order to be able to determine an appropriate sibling tag that will
822- // receive focus.
823- if ( this . isValidIndex ( tagIndex ) && tag . hasFocus ) {
824- this . lastDestroyedTagIndex = tagIndex ;
825- } else if ( this . isValidIndex ( tagIndex ) && ! tag . hasFocus ) {
826- this . focusInput ( ) ;
827- }
828- } ) ;
818+ this . tagRemoveSubscription = this . tagRemoveChanges
819+ . subscribe ( ( event ) => {
820+ const tag = event . tag ;
821+ const tagIndex = this . tags . toArray ( ) . indexOf ( event . tag ) ;
822+
823+ // In case the tag that will be removed is currently focused, we temporarily store
824+ // the index in order to be able to determine an appropriate sibling tag that will
825+ // receive focus.
826+ if ( this . isValidIndex ( tagIndex ) && tag . hasFocus ) {
827+ this . lastDestroyedTagIndex = tagIndex ;
828+ }
829+ } ) ;
829830 }
830831
831832 /** Checks whether an event comes from inside a tag element. */
0 commit comments