Skip to content

Commit

Permalink
Fix enter not working without search square
Browse files Browse the repository at this point in the history
Fixes issue #15
  • Loading branch information
etacarinaea committed Feb 2, 2022
1 parent c240af8 commit a85772c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,9 @@ function globalKeyListener(squares, e) {
}
} else if(key == 13) {
// enter
if(squares.search.searchinput !== document.activeElement &&
squares.normal[focusedSquare] !== undefined) {
if(typeof squares.search === "undefined" ||
(squares.search.searchinput !== document.activeElement &&
squares.normal[focusedSquare] !== undefined)) {
window.location = squares.normal[focusedSquare].props.links[focusedLink].url;
}
}
Expand Down

0 comments on commit a85772c

Please sign in to comment.