Skip to content

Commit 397622c

Browse files
committed
Fix array index out of bounds on enter key event zurb#773
1 parent 4f18b5e commit 397622c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/TributeEvents.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,8 @@ class TributeEvents {
228228
},
229229
enter: (e, el) => {
230230
// choose selection
231-
if (this.tribute.isActive && this.tribute.current.filteredItems) {
231+
const filteredItems = this.tribute.current.filteredItems;
232+
if (this.tribute.isActive && filteredItems && filteredItems.length) {
232233
e.preventDefault();
233234
e.stopPropagation();
234235
setTimeout(() => {

0 commit comments

Comments
 (0)