Skip to content

Commit 5e7fc80

Browse files
committed
fix: the speed selection should not go out of the viewport
Signed-off-by: Simon L. <szaimen@e.mail.de>
1 parent 7bcc76e commit 5e7fc80

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/components/Audios.vue

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,20 @@ audio {
157157
@import '../mixins/Plyr';
158158
}
159159
160+
// The settings menu (e.g. speed selection) is absolutely positioned and
161+
// opens upward from the controls. On short viewports its full height does
162+
// not fit and options get clipped off-screen. Cap its height to the
163+
// available viewport space and let it scroll internally so no option is
164+
// ever clipped, regardless of where the centered player sits.
165+
.plyr__menu__container {
166+
// The player is vertically centered, so the controls bar sits at
167+
// ~50vh and the menu opens upward into the top half of the viewport.
168+
// Cap to that available space (half the viewport, minus half the
169+
// controls bar and a top margin) so options never clip off-screen.
170+
max-height: calc(50vh - var(--plyr-button-size, 44px) / 2 - 20px);
171+
overflow-y: auto;
172+
}
173+
160174
// make it a bit off-center in order to fix mobile controls
161175
@media only screen and (max-width: 500px) {
162176
.plyr--audio {

0 commit comments

Comments
 (0)