From 7ebaaa71b71c5f5d5ecb81ce38c367ceacc837ce Mon Sep 17 00:00:00 2001 From: bvanvugt <1531419+bvanvugt@users.noreply.github.com> Date: Sat, 26 Aug 2023 19:31:58 +0000 Subject: [PATCH] Prevent scrub bar from being focused and eating hotkeys. --- src/lib/components/Scrubber.svelte | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/lib/components/Scrubber.svelte b/src/lib/components/Scrubber.svelte index 6f16e47..4498e7c 100644 --- a/src/lib/components/Scrubber.svelte +++ b/src/lib/components/Scrubber.svelte @@ -21,11 +21,16 @@ value = $playbackState.frame.turn; } - // Jump to frame on scrub event. Note that we can't use - // the bound `value` here because it hasn't updated yet. function onScrub(e: Event) { + // Jump to frame on scrub event. Note that we can't use + // the bound `value` here because it hasn't updated yet. playbackState?.controls.jumpToFrame(e.target.value); } + + function onFocus(e: Event) { + // Prevent input from being focused (it messes with hotkeys) + e.target.blur(); + } {#if $playbackState} @@ -36,6 +41,7 @@ {max} {step} {disabled} + on:focus={onFocus} on:input={onScrub} bind:value />