]> cat aescling's git repositories - mastodon.git/commitdiff
Fix video not taking focus on interaction
authorThibaut Girka <thib@sitedethib.com>
Fri, 20 Nov 2020 13:20:17 +0000 (14:20 +0100)
committerThibaut Girka <thib@sitedethib.com>
Fri, 20 Nov 2020 13:20:17 +0000 (14:20 +0100)
Revert part of #737 to restore hotkey functionality

app/javascript/flavours/glitch/features/video/index.js

index 21a2594e7b413effd05debaa82fd1f2dde96457c..ea40b6073dfe60377b7cf4aad212d4275632533e 100644 (file)
@@ -182,10 +182,7 @@ class Video extends React.PureComponent {
     this.volume = c;
   }
 
-  handleMouseDownRoot = e => {
-    e.preventDefault();
-    e.stopPropagation();
-  }
+  handleClickRoot = e => e.stopPropagation();
 
   handlePlay = () => {
     this.setState({ paused: false });
@@ -578,7 +575,7 @@ class Video extends React.PureComponent {
         ref={this.setPlayerRef}
         onMouseEnter={this.handleMouseEnter}
         onMouseLeave={this.handleMouseLeave}
-        onMouseDown={this.handleMouseDownRoot}
+        onClick={this.handleClickRoot}
         onKeyDown={this.handleKeyDown}
         tabIndex={0}
       >