Skip to content

Commit

Permalink
fix(FEC-8843): handle click outside when the menu is open (#366)
Browse files Browse the repository at this point in the history
when menus are open - just close the menu, dont play/pause as well
  • Loading branch information
odedhutzler authored and RoyBregman committed May 6, 2019
1 parent 3d07217 commit 9820c35
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/components/menu/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ class Menu extends Component {
this._menuElement &&
!this._menuElement.contains(e.target)
) {
e.stopPropagation();
this.props.onClose();
}
}
Expand Down
6 changes: 5 additions & 1 deletion src/components/overlay-action/overlay-action.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ const mapStateToProps = state => ({
isPlayingAdOrPlayback: isPlayingAdOrPlayback(state.engine),
iconType: state.overlayAction.iconType,
playerHover: state.shell.playerHover,
isMobile: state.shell.isMobile
isMobile: state.shell.isMobile,
isSmartContainerOpen: state.shell.smartContainerOpen
});

/**
Expand Down Expand Up @@ -179,6 +180,9 @@ class OverlayAction extends BaseComponent {
* @memberof OverlayAction
*/
overlayClick(): void {
if (this.props.isSmartContainerOpen) {
return;
}
const now = Date.now();
if (now - this._firstClickTime < PLAY_PAUSE_BUFFER_TIME) {
this.cancelClickTimeout();
Expand Down

0 comments on commit 9820c35

Please sign in to comment.