diff options
author | pacien | 2024-01-05 00:30:12 +0100 |
---|---|---|
committer | pacien | 2024-01-05 00:30:12 +0100 |
commit | c97536bf080a1c45634a91cee80dba3bad3c641c (patch) | |
tree | 12c29726c180639817c7a53ed313162fd482141c | |
parent | d28df77dac1bcb96c90e25ad2ea2c210e8b8294c (diff) | |
download | echoclip-c97536bf080a1c45634a91cee80dba3bad3c641c.tar.gz |
fix scrolling on space hold
-rw-r--r-- | app.js | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -53,9 +53,10 @@ function onGetDeviceSuccess(stream) { | |||
53 | }); | 53 | }); |
54 | 54 | ||
55 | document.addEventListener("keydown", event => { | 55 | document.addEventListener("keydown", event => { |
56 | if (mediaRecorder.state == "inactive" && event.key == " ") { | 56 | if (event.key == " ") { |
57 | event.preventDefault(); // prevent scroll | 57 | event.preventDefault(); // prevent scroll |
58 | mediaRecorder.start(); | 58 | if (mediaRecorder.state == "inactive") |
59 | mediaRecorder.start(); | ||
59 | } | 60 | } |
60 | }); | 61 | }); |
61 | 62 | ||