diff --git a/spot/bun.lockb b/spot/bun.lockb index 58ef0acb1..18d7c5959 100755 Binary files a/spot/bun.lockb and b/spot/bun.lockb differ diff --git a/spot/entrypoints/content/SavingControls.tsx b/spot/entrypoints/content/SavingControls.tsx index f32ee556b..d79c84ed5 100644 --- a/spot/entrypoints/content/SavingControls.tsx +++ b/spot/entrypoints/content/SavingControls.tsx @@ -38,6 +38,8 @@ function SavingControls({ getVideoData, getErrorEvents, }: ISavingControls) { + let nameInputRef: HTMLInputElement; + let descriptionInputRef: HTMLTextAreaElement; const [name, setName] = createSignal(`Issues in — ${document.title}`); const [description, setDescription] = createSignal(""); const [currentTime, setCurrentTime] = createSignal(0); @@ -62,6 +64,43 @@ function SavingControls({ }); }); + createEffect(() => { + const stopEvents = (e: Event) => { + e.stopPropagation(); + e.stopImmediatePropagation(); + }; + if (nameInputRef) { + nameInputRef.addEventListener('keydown', stopEvents, true); + nameInputRef.addEventListener('keyup', stopEvents, true); + nameInputRef.addEventListener('keypress', stopEvents, true); + nameInputRef.addEventListener('input', stopEvents, true); + nameInputRef.addEventListener('change', stopEvents, true); + + onCleanup(() => { + nameInputRef.removeEventListener('keydown', stopEvents, true); + nameInputRef.removeEventListener('keyup', stopEvents, true); + nameInputRef.removeEventListener('keypress', stopEvents, true); + nameInputRef.removeEventListener('input', stopEvents, true); + nameInputRef.removeEventListener('change', stopEvents, true); + }); + } + if (descriptionInputRef) { + descriptionInputRef.addEventListener('keydown', stopEvents, true); + descriptionInputRef.addEventListener('keyup', stopEvents, true); + descriptionInputRef.addEventListener('keypress', stopEvents, true); + descriptionInputRef.addEventListener('input', stopEvents, true); + descriptionInputRef.addEventListener('change', stopEvents, true); + + onCleanup(() => { + descriptionInputRef.removeEventListener('keydown', stopEvents, true); + descriptionInputRef.removeEventListener('keyup', stopEvents, true); + descriptionInputRef.removeEventListener('keypress', stopEvents, true); + descriptionInputRef.removeEventListener('input', stopEvents, true); + descriptionInputRef.removeEventListener('change', stopEvents, true); + }); + } + }); + const spacePressed = (e: KeyboardEvent) => { if ( e.target instanceof HTMLInputElement || @@ -72,6 +111,7 @@ function SavingControls({ } e.preventDefault(); e.stopPropagation(); + e.stopImmediatePropagation() if (e.key === " ") { if (playing()) { pause(); @@ -456,19 +496,25 @@ function SavingControls({