Skip to content

Commit

Permalink
fix(dropdown): fetch js error on non existing letter selections
Browse files Browse the repository at this point in the history
When a dropdown is open, if you type a letter to match a label in the dropdown, an error occurs.

Note that you have to type a letter to match a label in the dropdown. If there isn't an entry starting with the letter given, no error will occur.
  • Loading branch information
lubber-de authored Apr 9, 2024
1 parent 45d16a0 commit f0d7450
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/definitions/modules/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -2677,7 +2677,7 @@
module.set.scrollPosition($nextValue);
$selectedItem.removeClass(className.selected);
$nextValue.addClass(className.selected);
if (settings.selectOnKeydown && module.is.single() && !$nextItem.hasClass(className.actionable)) {
if (settings.selectOnKeydown && module.is.single() && (!$nextItem || !$nextItem.hasClass(className.actionable))) {
module.set.selectedItem($nextValue);
}
}
Expand Down

0 comments on commit f0d7450

Please sign in to comment.