Skip to content

Commit

Permalink
fix: don't perform global action when input active
Browse files Browse the repository at this point in the history
  • Loading branch information
iyzana committed Feb 19, 2023
1 parent 8ad9a75 commit 27fd98b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,12 @@ function App() {
console.log('sending websocket message: ' + message);
ws.send(message);
}, []);

useEffect(() => {
document.onkeydown = (event: KeyboardEvent) => {
if (document.activeElement instanceof HTMLInputElement) {
return;
}
if (event.key === 'N') {
sendMessage('skip');
}
Expand Down

0 comments on commit 27fd98b

Please sign in to comment.