Skip to content

Commit f330474

Browse files
committed
Initialize _focusLastChipOnBackspace correctly
1 parent 47f0b43 commit f330474

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/material/chips/chip-list.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ export class MatChipList extends _MatChipListMixinBase implements MatFormFieldCo
131131
private _chipRemoveSubscription: Subscription | null;
132132

133133
/** Used to prevent focus moving to chips while user is holding backspace */
134-
private _focusLastChipOnBackspace = false;
134+
private _focusLastChipOnBackspace: boolean;
135135

136136
/** The chip input to add more chips */
137137
protected _chipInput: MatChipTextControl;
@@ -418,10 +418,10 @@ export class MatChipList extends _MatChipListMixinBase implements MatFormFieldCo
418418
this._dropSubscriptions();
419419
}
420420

421-
422421
/** Associates an HTML input element with this chip list. */
423422
registerInput(inputElement: MatChipTextControl): void {
424423
this._chipInput = inputElement;
424+
this._focusLastChipOnBackspace = inputElement.empty;
425425
}
426426

427427
/**

0 commit comments

Comments
 (0)