Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The prop onClick cannot trigger on mobile Safari #13

Open
Xing-He opened this issue Dec 18, 2018 · 0 comments
Open

The prop onClick cannot trigger on mobile Safari #13

Xing-He opened this issue Dec 18, 2018 · 0 comments

Comments

@Xing-He
Copy link

Xing-He commented Dec 18, 2018

Event Click just cannot trigger on mobile safari , and it may be changed to touch Event

and i did some change.

    const videoProps = {
      ref: v => this.video = v,
      src: typeof this.props.src === 'string' ? this.props.src : null,
      preload: this.props.preload,
      poster: this.props.poster,
      muted: this.props.muted,
      loop: this.props.loop,
+      onTouchStart:this.props.onClick,
      onTimeUpdate: this._handleTimeUpdate,
      onEnded: this._handleVideoEnd,
      ...Object.assign(this.props.extraVideoElementProps, { playsInline: this.props.playsInline })
    };

    return (
      <div
        ref={r => this.container = r}
        className={`BackgroundVideo ${this.props.className}`}
        style={Object.assign({ ...absolute100, visibility }, this.props.style)}
-      onClick={this.props.onClick}
+        // onClick={this.props.onClick}
        onKeyPress={this.props.onKeyPress}
        tabIndex={this.props.tabIndex}
      >
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant