Lightbox: Ensure that click of video pauses it

This commit is contained in:
Scott Nonnenberg 2019-09-19 14:47:35 -07:00
parent 23b720a982
commit 43ac8ce37e
2 changed files with 2 additions and 5 deletions

View file

@ -71,6 +71,7 @@ const styles = {
maxWidth: '100%',
maxHeight: '100%',
objectFit: 'contain',
outline: 'none',
} as React.CSSProperties,
caption: {
position: 'absolute',
@ -171,13 +172,10 @@ const Icon = ({
export class Lightbox extends React.Component<Props> {
private readonly containerRef: React.RefObject<HTMLDivElement>;
private readonly videoRef: React.RefObject<HTMLVideoElement>;
private readonly playVideoBound: () => void;
constructor(props: Props) {
super(props);
this.playVideoBound = this.playVideo.bind(this);
this.videoRef = React.createRef();
this.containerRef = React.createRef();
}
@ -292,7 +290,6 @@ export class Lightbox extends React.Component<Props> {
<video
role="button"
ref={this.videoRef}
onClick={this.playVideoBound}
controls={true}
style={styles.object}
key={objectURL}

View file

@ -7493,7 +7493,7 @@
"rule": "React-createRef",
"path": "ts/components/Lightbox.tsx",
"line": " this.videoRef = React.createRef();",
"lineNumber": 181,
"lineNumber": 179,
"reasonCategory": "usageTrusted",
"updated": "2019-03-09T00:08:44.242Z",
"reasonDetail": "Used to auto-start playback on videos"