fix: cursor/controls linger after seek when 'hide controls when paused' is enabled (#3634)#3635
Conversation
…y#3634) When 'hide controls when paused' is enabled, after the user interacts with the progress bar (e.g. seeks), the onmousestop loop kept rescheduling itself indefinitely while .ytp-progress-bar:hover was true — so the cursor/controls never hid until the mouse moved away. Fix: attach a 'mouseup' listener on the player element that schedules a clean 1-second hide timer (bypassing the hover guard) once the user releases the mouse button after a seek interaction. The listener is cleaned up when the feature is disabled or the video is no longer paused.
|
I tested this PR locally on Brave (Windows 11) with “Hide controls when paused” enabled. After seeking with the progress bar and releasing the mouse button (without moving the cursor), the controls still remain visible. It seems the mouseup event might not always fire on the player element during progress bar interactions. Possibly the listener needs to be attached higher or directly to the progress bar element? |
YouTube's progress bar stops mouseup event propagation, so the handler on the player element never fires when seeking via the progress bar. Move the listener to document with a guard that only triggers when the mouseup target is inside the player or progress bar.
|
Thanks for testing! You're right — YouTube's progress bar likely calls I've pushed a fix: the mouseup listener now attaches to |
scheduleHide() defers by 1s and onmousestop re-checks .ytp-progress-bar:hover, which keeps controls visible when the cursor rests on the scrubber after seeking. Instead, clear the timer and call hideControls() directly on mouseup so controls disappear immediately when the user releases the mouse after a seek.
|
Thanks for testing on Brave! Good diagnosis — the root cause was that Fixed in the latest push: on |
|
Good catch! The root issue was that even though The fix: instead of calling |
Problem
Fixes #3634
When the "Hide controls when paused" setting is enabled, after the user interacts with the progress bar (e.g. seeks to a new position), the mouse cursor and control bar take a long time to disappear — or never disappear until the mouse is moved away.
Root cause
In
playerControls(), theonmousestopcallback checks.ytp-progress-bar:hoverbefore hiding controls. After a seek click, the progress bar remains in a:hoverstate, soonmousestopkeeps rescheduling itself in a 1-second loop indefinitely — the controls never hide.Fix
Attach a
mouseuplistener on the player element. When the user releases the mouse button after a seek, it schedules a clean 1-second hide timer that bypasses the hover guard. The listener is properly cleaned up when the feature is disabled or the video resumes playing.Testing