Skip to content

Commit

Permalink
Prevent default on anagram helper enter key down (#80)
Browse files Browse the repository at this point in the history
Co-authored-by: tblackwell-tm <[email protected]>
  • Loading branch information
t-blackwell and tblackwell-tm authored Mar 15, 2024
1 parent 8f548f3 commit 0ee4653
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/components/AnagramHelper/AnagramHelper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ export default function AnagramHelper({
onChange={(event) => setLetters(event.target.value)}
onKeyDown={(event) => {
if (['Enter', 'NumpadEnter'].includes(event.code)) {
event.preventDefault();
shuffle();
} else if (event.code === 'Escape') {
// on esc, clear or close
Expand Down

0 comments on commit 0ee4653

Please sign in to comment.