Skip to content

Commit

Permalink
Hitting Return in a modal just closes the modal
Browse files Browse the repository at this point in the history
Closes #12
  • Loading branch information
qsantos committed Jun 25, 2024
1 parent 713978a commit f38ba53
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -1096,6 +1096,9 @@ document.addEventListener('keydown', (event) => {

// hitting Return starts the keying
if (!inSession && userInput === 'enter') {
if (settingsModalElement.open) { settingsModalElement.close(); event.preventDefault(); return; }
if (infoModalElement.open) { infoModalElement.close(); event.preventDefault(); return; }
if (statsModalElement.open) { statsModalElement.close(); event.preventDefault(); return; }
startSession();
}

Expand Down

0 comments on commit f38ba53

Please sign in to comment.