Skip to content

Commit

Permalink
Prevent scrub bar from being focused and eating hotkeys.
Browse files Browse the repository at this point in the history
  • Loading branch information
bvanvugt committed Aug 26, 2023
1 parent 5e5e270 commit 7ebaaa7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/lib/components/Scrubber.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
</script>

{#if $playbackState}
Expand All @@ -36,6 +41,7 @@
{max}
{step}
{disabled}
on:focus={onFocus}
on:input={onScrub}
bind:value
/>
Expand Down

0 comments on commit 7ebaaa7

Please sign in to comment.