diff options
author | eug-vs <eugene@eug-vs.xyz> | 2022-06-11 13:59:34 +0300 |
---|---|---|
committer | eug-vs <eugene@eug-vs.xyz> | 2022-06-11 14:01:07 +0300 |
commit | 0c7c2c8b5033cceb064a34cbb640d1272fff8ed8 (patch) | |
tree | 43f86404064014680a6d29b37651803e514bc9a5 /src/components/Timer.tsx | |
parent | 3e3e29527f7bf7b72363a1193b3ee310b1adc2fa (diff) | |
download | chrono-cube-ui-master.tar.gz |
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 => { |