Skip to content

Commit

Permalink
Fix array index out of bounds on enter key event zurb#773
Browse files Browse the repository at this point in the history
  • Loading branch information
SrPatinhas committed Oct 6, 2023
1 parent 4f18b5e commit 397622c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/TributeEvents.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@ class TributeEvents {
},
enter: (e, el) => {
// choose selection
if (this.tribute.isActive && this.tribute.current.filteredItems) {
const filteredItems = this.tribute.current.filteredItems;
if (this.tribute.isActive && filteredItems && filteredItems.length) {
e.preventDefault();
e.stopPropagation();
setTimeout(() => {
Expand Down

0 comments on commit 397622c

Please sign in to comment.