Skip to content

Commit

Permalink
fix(ui): Fix hiding controls on mobile after closing menu
Browse files Browse the repository at this point in the history
Conflicting touch event listeners in OverflowMenu and Controls led to
a weird situation in which the controls container was seen as being
hovered after tapping to close the overflow menu.  This, in turn, led
the controls to stay open instead of hiding.

Removing the extra event listener in OverflowMenu allows the controls
to be properly hidden when the overflow menu is closed.

Issue shaka-project#2886

Change-Id: I18688efbcc6c4129b7b03e9daf00964d3a8d9802
  • Loading branch information
joeyparrish committed Oct 1, 2020
1 parent 54d48e1 commit bfc2a75
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions ui/overflow_menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,6 @@ shaka.ui.OverflowMenu = class extends shaka.ui.Element {
this.onOverflowMenuButtonClick_();
});

this.eventManager.listen(
this.controlsContainer_, 'touchstart', (event) => {
// If the overflow menu is showing, hide it on a touch event
if (!this.overflowMenu_.classList.contains('shaka-hidden')) {
shaka.ui.Utils.setDisplay(this.overflowMenu_, false);
// Stop this event from becoming a click event.
event.preventDefault();
}
});

this.updateAriaLabel_();
}

Expand Down

0 comments on commit bfc2a75

Please sign in to comment.