fix(menu): add max-height and scroll to settings menu panel#2893
Open
terminalchai wants to merge 1 commit intosampotts:developfrom
Open
fix(menu): add max-height and scroll to settings menu panel#2893terminalchai wants to merge 1 commit intosampotts:developfrom
terminalchai wants to merge 1 commit intosampotts:developfrom
Conversation
… items When a player has many quality options or caption tracks (e.g. 30 languages), the settings menu panel grows beyond the viewport with no way to scroll, clipping the excess items. Add a \\-menu-max-height\ SCSS variable (backed by the \--plyr-menu-max-height\ CSS custom property, defaulting to 240px) and apply it to the \[role='menu']\ container along with \overflow-y: auto\. This caps the panel height at 240px and lets it scroll, without touching any ARIA roles or JS logic. Fixes sampotts#1420
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.
Summary
Fixes #1420
Problem
When a player has many quality options or caption/language tracks, the settings menu panel has no height constraint — it grows as tall as needed and clips off-screen, with no way to scroll to the hidden items.
A previous attempt (comment) solved this by adding a new [role='menu-captions']\ element, but as @sampotts noted that's not a valid ARIA role.
Fix
Two small changes, no JS touched:
*\src/sass/settings/menus.scss* — add a new variable following the existing pattern:
\\scss
-menu-max-height: var(--plyr-menu-max-height, 240px) !default;
\\
*\src/sass/components/menus.scss* — apply it to the existing [role='menu']\ selector:
\\diff
[role='menu'] {
padding: -control-padding;
}
\\
The \240px\ default shows roughly 7–8 items before scrolling kicks in. Both the SCSS variable and the --plyr-menu-max-height\ CSS custom property can be overridden by consumers who need a different height.