]> cat aescling's git repositories - mastodon.git/commitdiff
Fix opening/closing gifv sometimes making the timeline scroll
authorThibaut Girka <thib@sitedethib.com>
Tue, 16 Apr 2019 16:45:04 +0000 (18:45 +0200)
committerThibG <thib@sitedethib.com>
Tue, 16 Apr 2019 20:20:23 +0000 (22:20 +0200)
app/javascript/flavours/glitch/components/media_gallery.js
app/javascript/flavours/glitch/components/modal_root.js
app/javascript/flavours/glitch/styles/components/media.scss

index 6be2b4700a9483e481d156b80ac816831533e5ac..b7360bae47efadc48a23f825bb99199ae1856cf5 100644 (file)
@@ -82,11 +82,6 @@ class Item extends React.PureComponent {
     e.stopPropagation();
   }
 
-  handleMouseDown = (e) => {
-    e.preventDefault();
-    e.stopPropagation();
-  }
-
   render () {
     const { attachment, index, size, standalone, letterbox, displayWidth } = this.props;
 
@@ -190,7 +185,6 @@ class Item extends React.PureComponent {
             onClick={this.handleClick}
             onMouseEnter={this.handleMouseEnter}
             onMouseLeave={this.handleMouseLeave}
-            onMouseDown={this.handleMouseDown}
             autoPlay={autoPlay}
             loop
             muted
index 7a90e6b8a41cc4b8900fbf694f8964b40f8a8785..4e8648b497ac5acdd3d53590f68d7d22bb67bdcf 100644 (file)
@@ -40,7 +40,7 @@ export default class ModalRoot extends React.PureComponent {
       this.setState({ revealed: false });
     }
     if (!nextProps.children && !!this.props.children) {
-      this.activeElement.focus();
+      this.activeElement.focus({ preventScroll: true });
       this.activeElement = null;
     }
   }
index e8011bde902a08678bd99db01ad3a059a5fcbd5b..fabef2a5654a45d45f73ad99a1adf9909d80ad82 100644 (file)
   position: relative;
   z-index: 1;
   object-fit: contain;
+  user-select: none;
 
   &:not(.letterbox) {
     height: 100%;