Skip to content

Commit

Permalink
fix: Pressing arrow keys while focused on inputs no longer advances t…
Browse files Browse the repository at this point in the history
…imestamp
  • Loading branch information
ShrimpCryptid committed Sep 26, 2024
1 parent 0eeee38 commit be05987
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/Viewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -688,10 +688,13 @@ function Viewer(): ReactElement {
timeControls.setFrameCallback(setFrame);

const handleKeyDown = useCallback(
({ key }: KeyboardEvent): void => {
if (key === "ArrowLeft" || key === "Left") {
(e: KeyboardEvent): void => {
if (e.target instanceof HTMLInputElement) {
return;
}
if (e.key === "ArrowLeft" || e.key === "Left") {
timeControls.advanceFrame(-1);
} else if (key === "ArrowRight" || key === "Right") {
} else if (e.key === "ArrowRight" || e.key === "Right") {
timeControls.advanceFrame(1);
}
},
Expand Down

0 comments on commit be05987

Please sign in to comment.