Skip to content

Commit

Permalink
Lightbox: Ensure that click of video pauses it
Browse files Browse the repository at this point in the history
  • Loading branch information
scottnonnenberg-signal committed Sep 24, 2019
1 parent 23b720a commit 43ac8ce
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions ts/components/Lightbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ const styles = {
maxWidth: '100%',
maxHeight: '100%',
objectFit: 'contain',
outline: 'none',
} as React.CSSProperties,
caption: {
position: 'absolute',
Expand Down Expand Up @@ -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();
}
Expand Down Expand Up @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion ts/util/lint/exceptions.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 43ac8ce

Please sign in to comment.