Skip to content

Commit

Permalink
Adapt keyboard.js to handle undefined as well as null
Browse files Browse the repository at this point in the history
  • Loading branch information
timja committed Dec 12, 2024
1 parent d22cc2f commit 7e43507
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/js/util/keyboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export default function makeKeyboardNavigable(
}

function scrollAndSelect(selectedItem, selectedClass, items) {
if (selectedItem !== null) {
if (selectedItem) {
if (!isInViewport(selectedItem)) {
selectedItem.scrollIntoView(false);
}
Expand Down

0 comments on commit 7e43507

Please sign in to comment.