Skip to content

Commit

Permalink
fix(FEC-7963): native menus are not opened in mobile devices (Androi…
Browse files Browse the repository at this point in the history
…d/iOS) (#189)

Issue occurs because the shell catch any click on it and focused his own element.
Moved the pre playback click logic to the pre playback component.
  • Loading branch information
Dan Ziv committed Feb 28, 2018
1 parent 146ccaf commit 511f5ed
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
Expand Up @@ -95,6 +95,7 @@ class PrePlaybackPlayOverlay extends BaseComponent {
* @memberof PrePlaybackPlayOverlay
*/
handleClick(): void {
this.player.getView().focus();
this.player.play();
if (this.props.prePlayback) {
this._hidePrePlayback();
Expand Down Expand Up @@ -127,14 +128,14 @@ class PrePlaybackPlayOverlay extends BaseComponent {
style={rootStyle}
onClick={() => this.handleClick()}>
{<a className={style.prePlaybackPlayButton}
tabIndex="0"
onKeyDown={(e) => {
if (e.keyCode === KeyMap.ENTER) {
this.handleClick();
}
}}>
{props.isEnded ? <Icon type={IconType.StartOver}/> : <Icon type={IconType.Play}/>}
</a>}
tabIndex="0"
onKeyDown={(e) => {
if (e.keyCode === KeyMap.ENTER) {
this.handleClick();
}
}}>
{props.isEnded ? <Icon type={IconType.StartOver}/> : <Icon type={IconType.Play}/>}
</a>}
</div>
)
}
Expand Down
5 changes: 0 additions & 5 deletions src/components/shell/shell.js
Expand Up @@ -50,7 +50,6 @@ class Shell extends BaseComponent {
state: Object;
_hoverTimeout: number;
_fallbackToMutedAutoPlayMode: boolean;
_el: HTMLDivElement;

/**
* Creates an instance of Shell.
Expand Down Expand Up @@ -115,9 +114,6 @@ class Shell extends BaseComponent {
this.player.muted = false;
this._fallbackToMutedAutoPlayMode = false;
}
if (!this.state.nav) {
this._el.focus();
}
}

/**
Expand Down Expand Up @@ -226,7 +222,6 @@ class Shell extends BaseComponent {
return (
<div
tabIndex="0"
ref={el => this._el = el}
className={playerClasses}
onClick={() => this.onClick()}
onMouseOver={() => this.onMouseOver()}
Expand Down

0 comments on commit 511f5ed

Please sign in to comment.