Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
fix(chips): fixes issue with deletion logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Messerle committed Apr 16, 2015
1 parent 27ad2a5 commit 6d4ecbe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/chips/js/chipsController.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@
this.removeAndSelectAdjacentChip(this.selectedChip);
break;
case this.$mdConstant.KEY_CODE.LEFT_ARROW:
if (this.selectedChip < 0) this.selectedChip = this.items.length;
event.preventDefault();
if (this.selectedChip < 0) this.selectedChip = this.items.length;
if (this.items.length) this.selectAndFocusChipSafe(this.selectedChip - 1);
break;
case this.$mdConstant.KEY_CODE.RIGHT_ARROW:
Expand Down Expand Up @@ -331,7 +331,7 @@
inputElement
.attr({ tabindex: 0 })
.on('keydown', function(event) { scope.$apply(function() { ctrl.inputKeydown(event); }); })
.on('focus', function () { scope.$apply(function () { ctrl.selectedChip = null; }); });
.on('focus', function () { ctrl.selectedChip = -1; });
};

MdChipsCtrl.prototype.configureAutocomplete = function(ctrl) {
Expand Down

0 comments on commit 6d4ecbe

Please sign in to comment.