Skip to content

Fix: permanent player tooltip #9119

Open
Shadorc wants to merge 5 commits into
FreeTubeApp:developmentfrom
Shadorc:fix/permanent-tooltip
Open

Fix: permanent player tooltip #9119
Shadorc wants to merge 5 commits into
FreeTubeApp:developmentfrom
Shadorc:fix/permanent-tooltip

Conversation

@Shadorc
Copy link
Copy Markdown
Contributor

@Shadorc Shadorc commented May 10, 2026

Pull Request Type

  • Bugfix
  • Feature Implementation
  • Documentation
  • Other

Related issue

closes #8046

Description

When a button is clicked, it gains :focus, and then, when a shortcut is used (it can be any button in the player and the button clicked does not need to be hovered anymore), the :focus-visible state becomes true and stay like this until the focus is lost by clicking elsewhere.
According to Shaka Player's CSS rules), the :focus-visible pseudo-class keeps the tooltip visible until focus is removed.

Calling blur() after a keyboard shortcut is triggered removes the focus by clearing the :focus-visible state, hiding the tooltip.

Screenshots

No visible change to show

Testing

Scenario 1

  1. Click on a player button, eg play/pause
  2. Now use the shortcut for it, k
  3. Label is now not permanently showing and does not obstruct other player labels

Scenario 2 (thanks aditya0155)

  1. Click on a player button, eg play/pause
  2. Now use the shortcut for another one, eg m
  3. Label is now not permanently showing and does not obstruct other player labels

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) May 10, 2026 00:27
@github-actions github-actions Bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label May 10, 2026
auto-merge was automatically disabled May 10, 2026 13:49

Head branch was pushed to by a user without write access

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) May 10, 2026 13:49
@aditya0155
Copy link
Copy Markdown
Contributor

aditya0155 commented May 10, 2026

I found a small edge case:

  1. Click the Mute button with mouse
  2. Do not click anywhere else and press k or Spacebar
minor_edge_case.mp4

@Shadorc
Copy link
Copy Markdown
Contributor Author

Shadorc commented May 10, 2026

Thanks for testing, it is indeed a bug! It comes from the fact that I only clear tooltip for the button corresponding to the shortcut key, but it could be a different tooltip shown.
It could be fixed by either calling blur on all buttons each times, the safest approach but the more maintenance-needed one, or call blur on the whole document.activeElement, but it could prevent specific feature like navigation with keyboards.
I will fix it using the first approach

auto-merge was automatically disabled May 10, 2026 20:33

Head branch was pushed to by a user without write access

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) May 10, 2026 20:34
auto-merge was automatically disabled May 10, 2026 20:41

Head branch was pushed to by a user without write access

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) May 10, 2026 20:41
@aditya0155
Copy link
Copy Markdown
Contributor

edge_case.mp4

the edge case is fixed from my testing

Co-authored-by: PikachuEXE <git@pikachuexe.net>
auto-merge was automatically disabled May 12, 2026 10:28

Head branch was pushed to by a user without write access

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) May 12, 2026 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: waiting for review For PRs that are complete, tested, and ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request]: Ensure player control labels do not overlap or interfere with each other

3 participants