Skip to content

Commit

Permalink
Avoid js error when no menu items exist.
Browse files Browse the repository at this point in the history
  • Loading branch information
frjo committed Aug 20, 2024
1 parent b0bb12a commit 2a38980
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions assets/js/mobile.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@
});

// Move focus back to button efter user tab out of last link.
const lastlink = [].slice.call(links).pop();
lastlink.addEventListener('blur', () => toggle.focus());
if (links.length) {
const lastlink = [].slice.call(links).pop();
lastlink.addEventListener('blur', () => toggle.focus());
}

})();

0 comments on commit 2a38980

Please sign in to comment.