From 43ac8ce37e68318450a7a44b3e5f96ed28b654cb Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg <scott@signal.org> Date: Thu, 19 Sep 2019 14:47:35 -0700 Subject: [PATCH] Lightbox: Ensure that click of video pauses it --- ts/components/Lightbox.tsx | 5 +---- ts/util/lint/exceptions.json | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/ts/components/Lightbox.tsx b/ts/components/Lightbox.tsx index d42cd8d944..3a695e753f 100644 --- a/ts/components/Lightbox.tsx +++ b/ts/components/Lightbox.tsx @@ -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} diff --git a/ts/util/lint/exceptions.json b/ts/util/lint/exceptions.json index 7744ae7e14..5c27b582cb 100644 --- a/ts/util/lint/exceptions.json +++ b/ts/util/lint/exceptions.json @@ -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"