Skip to content

Commit

Permalink
fix(player): default themed menu not interactable on mobile
Browse files Browse the repository at this point in the history
closes #1163
  • Loading branch information
mihar-22 committed Feb 15, 2024
1 parent 8f1fe4d commit 94b25fa
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions packages/vidstack/src/components/ui/menu/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ export class Menu extends Component<MenuProps, {}, MenuEvents> {
effect(() => {
const { height } = this._media.$state,
content = this._content();

content && setStyle(content, '--player-height', height() + 'px');
});

Expand Down Expand Up @@ -245,7 +246,7 @@ export class Menu extends Component<MenuProps, {}, MenuEvents> {
const onTransition = this._onResizeTransition.bind(this);
items.listen('transitionstart', onTransition);
items.listen('transitionend', onTransition);

items.listen('animationend', this._onResize);
items.listen('vds-menu-resize' as any, this._onResize);
}
}
Expand Down Expand Up @@ -367,6 +368,7 @@ export class Menu extends Component<MenuProps, {}, MenuEvents> {

private _onWindowPointerUp(event: Event) {
const isTargetNode = event.target instanceof Node;

if (!isTargetNode || this._content()?.contains(event.target)) return;

// A little delay so submenu closing doesn't jump menu size when closing.
Expand Down Expand Up @@ -473,12 +475,7 @@ export class Menu extends Component<MenuProps, {}, MenuEvents> {
}
}

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

protected _onResizeTransition(event: TransitionEvent) {
Expand Down

0 comments on commit 94b25fa

Please sign in to comment.