about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/components/media_gallery.js
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2018-09-17 14:19:35 +0200
committerThibG <thib@sitedethib.com>2018-09-21 12:56:13 +0200
commit925c185ef9cfba24cdeb7c3555b7f75c55738cab (patch)
treee96533bf74e21191df3224fe03d1a235f4bd46a4 /app/javascript/flavours/glitch/components/media_gallery.js
parent5c9a2f5d77387792c6953a205de06cbe3bcbcac0 (diff)
Prevent clicks on video from initiating selections
Diffstat (limited to 'app/javascript/flavours/glitch/components/media_gallery.js')
-rw-r--r--app/javascript/flavours/glitch/components/media_gallery.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/javascript/flavours/glitch/components/media_gallery.js b/app/javascript/flavours/glitch/components/media_gallery.js
index 1de12c5e0..605a2862b 100644
--- a/app/javascript/flavours/glitch/components/media_gallery.js
+++ b/app/javascript/flavours/glitch/components/media_gallery.js
@@ -78,6 +78,11 @@ class Item extends React.PureComponent {
     e.stopPropagation();
   }
 
+  handleMouseDown = (e) => {
+    e.preventDefault();
+    e.stopPropagation();
+  }
+
   render () {
     const { attachment, index, size, standalone, letterbox, displayWidth } = this.props;
 
@@ -181,6 +186,7 @@ class Item extends React.PureComponent {
             onClick={this.handleClick}
             onMouseEnter={this.handleMouseEnter}
             onMouseLeave={this.handleMouseLeave}
+            onMouseDown={this.handleMouseDown}
             autoPlay={autoPlay}
             loop
             muted