Skip to content

Commit 7aa87ec

Browse files
committed
fix(chips): fix chip list focus and keyboard behaviors
1 parent 3571f68 commit 7aa87ec

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/lib/chips/chip-list.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -432,9 +432,9 @@ export class MdChipList implements MdFormFieldControl<any>, ControlValueAccessor
432432

433433
let isPrevKey = (code === (isRtl ? RIGHT_ARROW : LEFT_ARROW));
434434
let isNextKey = (code === (isRtl ? LEFT_ARROW : RIGHT_ARROW));
435-
let isBackKey = (code === BACKSPACE || code == DELETE || code == UP_ARROW || isPrevKey);
435+
let isDeleteKey = code === BACKSPACE || code == DELETE;
436436
// If they are on an empty input and hit backspace/delete/left arrow, focus the last chip
437-
if (isInputEmpty && isBackKey) {
437+
if (isInputEmpty && isDeleteKey) {
438438
this._keyManager.setLastItemActive();
439439
event.preventDefault();
440440
return;
@@ -504,8 +504,6 @@ export class MdChipList implements MdFormFieldControl<any>, ControlValueAccessor
504504
if (focusChip) {
505505
focusChip.focus();
506506
}
507-
} else if (chipsArray.length === 0) {
508-
this._focusInput();
509507
}
510508

511509
// Reset our destroyed index

0 commit comments

Comments
 (0)