Repository navigation
Make the seeking bar work from the keyboard - #1369
Open
captbaritone wants to merge 2 commits into
Open
captbaritone wants to merge 2 commits into
captbaritone wants to merge 2 commits into
Conversation
The position slider only seeked on pointerup. Keyboard (and screen reader) changes fired input, which updated the scrub preview but never seeked. - Arrow keys now seek -/+5 seconds, like the arrow key hotkeys. The native 1% step can be smaller than the one second resolution of the displayed position, which would leave short tracks stuck when paused. - Other input that does not come from a pointer (Home/End/PageUp/PageDown, assistive tech increment/decrement) seeks immediately. - Pointer dragging is unchanged: preview while dragging, seek on release.
✅ Deploy Preview for tourmaline-kringle-c98715 canceled.
|
|
Size Change: +406 B (+0.08%) Total Size: 491 kB 📦 View Changed
|
Screen readers announced these range inputs as bare numbers (e.g. "26" for the seeking bar). Describe their values instead: - Seeking Bar: "0:32 of 2:00" (the scrub position while dragging) - Volume Bar: "75%" - Balance: "Center", "20% Left" or "20% Right"
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The seeking bar (
#position, an<input type="range">) can be focused, but only seeks inonPointerUp. Arrow keys fireonInput, which only updates the scrub preview. The clock display moves, but playback never seeks, and the slider stays stuck in "scrubbing" mode until the next pointer interaction.Changes
seekForward/seekBackwardaction creators that the arrow-key hotkeys use. I didn't keep the native 1% step: the displayed position usesMath.floor(timeElapsed), so on tracks shorter than 100s a 1% step rounds back to the same value, and a paused track would never get past the start.The global hotkeys already ignore events from
<input>s, so withenableHotkeyson there's no double seek.Testing
Position.test.tsx(thirty seconds into a two-minute track):tsc,eslint,prettier --checkandvitest runpass locally.