diff options
Diffstat (limited to 'src/components/Timer.tsx')
-rw-r--r-- | src/components/Timer.tsx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/components/Timer.tsx b/src/components/Timer.tsx index 2d07608..287ebc0 100644 --- a/src/components/Timer.tsx +++ b/src/components/Timer.tsx @@ -63,8 +63,10 @@ const Timer: React.FC<PropTypes> = ({ registerResult, maxCountdown = 15000 }) => }, [mode, maxCountdown]); const handleKeyPress = (event: KeyboardEvent): void => { - event.preventDefault(); - if (event.keyCode === KEY_CODE && mode === Mode.idle) setMode(Mode.countdown); + if (event.keyCode === KEY_CODE && mode === Mode.idle) { + event.preventDefault(); + setMode(Mode.countdown); + } }; const handleKeyUp = (event: KeyboardEvent): void => { |