Skip to content

Commit

Permalink
fix(player): scrollbar styles not applying on chromium 121+
Browse files Browse the repository at this point in the history
  • Loading branch information
mihar-22 committed Feb 2, 2024
1 parent 4217dfe commit 6404bfe
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
9 changes: 6 additions & 3 deletions packages/vidstack/player/styles/default/menus.css
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,11 @@
}

:where(.vds-menu-items) {
--vds-scrollbar-thumb: var(--media-menu-scrollbar-thumb-bg, rgb(245 245 245 / 0.1));
box-sizing: border-box;
min-width: var(--media-menu-min-width, 280px);
scrollbar-width: thin;
scrollbar-color: var(--vds-scrollbar-thumb) var(--media-menu-scrollbar-track-bg, transparent);
}

:where(.vds-menu-items)::-webkit-scrollbar {
Expand All @@ -77,12 +79,12 @@
}

:where(.vds-menu-items)::-webkit-scrollbar-thumb {
background-color: var(--media-menu-scrollbar-thumb-bg, rgb(245 245 245 / 0.1));
background-color: var(--vds-scrollbar-thumb);
border-radius: 4px;
}

:where(.vds-menu-items)::-webkit-scrollbar-corner {
background-color: var(--media-menu-scrollbar-thumb-bg, rgb(245 245 245 / 0.1));
background-color: var(--vds-scrollbar-thumb);
}

/*
Expand Down Expand Up @@ -162,7 +164,7 @@
backdrop-filter: blur(4px);
height: var(--menu-height, auto);
will-change: width, height;
overflow-y: scroll;
overflow-y: auto;
overscroll-behavior: contain;
opacity: 0;
z-index: 9999999;
Expand All @@ -181,6 +183,7 @@
:where(.vds-menu-items[data-resizing]) {
--media-menu-scrollbar-thumb-bg: rgba(0, 0, 0, 0);
pointer-events: none;
overflow: hidden;
}

/*
Expand Down
9 changes: 6 additions & 3 deletions packages/vidstack/src/components/ui/menu/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -473,9 +473,12 @@ export class Menu extends Component<MenuProps, {}, MenuEvents> {
}
}

requestAnimationFrame(() => {
setStyle(content, '--menu-height', height + 'px');
});
if (parseFloat(styles.height) !== height) {
setAttribute(content, 'data-resizing', '');
requestAnimationFrame(() => {
setStyle(content, '--menu-height', height + 'px');
});
}
});

protected _onResizeTransition(event: TransitionEvent) {
Expand Down

0 comments on commit 6404bfe

Please sign in to comment.