Skip to content

Commit

Permalink
Merge pull request #527 from PolymerElements/selection-keydown
Browse files Browse the repository at this point in the history
Check selectionEnabled before _selectionHandler on keydown
  • Loading branch information
keanulee authored May 25, 2018
2 parents e31a151 + ffb30a8 commit 856f2b1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion iron-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -1876,7 +1876,7 @@
break;
case /* ENTER */ 13:
this._focusPhysicalItem(this._focusedVirtualIndex);
this._selectionHandler(e);
if (this.selectionEnabled) this._selectionHandler(e);
break;
}
},
Expand Down
5 changes: 5 additions & 0 deletions test/selection.html
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,11 @@
MockInteractions.tap(list._physicalItems[1]);

assert.equal(list.selectedItems.length, 0);

list._physicalItems[1].focus();
MockInteractions.keyDownOn(list._physicalItems[1], 13 /* ENTER */);

assert.equal(list.selectedItems.length, 0);
});

test('toggle', function() {
Expand Down

0 comments on commit 856f2b1

Please sign in to comment.