diff --git a/components/editor/AudioEditor.tsx b/components/editor/AudioEditor.tsx index cc8379e..a1fea09 100644 --- a/components/editor/AudioEditor.tsx +++ b/components/editor/AudioEditor.tsx @@ -99,8 +99,18 @@ export function AudioEditor() { // Keyboard shortcuts React.useEffect(() => { const handleKeyDown = (e: KeyboardEvent) => { - // Spacebar for play/pause - only if not typing in an input - if (e.code === 'Space' && !(e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement)) { + // Spacebar for play/pause - only if not interacting with form elements + if (e.code === 'Space') { + const target = e.target as HTMLElement; + // Don't trigger if user is typing or interacting with buttons/form elements + if ( + target instanceof HTMLInputElement || + target instanceof HTMLTextAreaElement || + target instanceof HTMLButtonElement || + target.getAttribute('role') === 'button' + ) { + return; + } e.preventDefault(); togglePlayPause(); }