forked from treehouse/mastodon
Fix opening/closing gifv sometimes making the timeline scroll
parent
f11ad4023c
commit
fbec0edf08
|
@ -82,11 +82,6 @@ class Item extends React.PureComponent {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
}
|
}
|
||||||
|
|
||||||
handleMouseDown = (e) => {
|
|
||||||
e.preventDefault();
|
|
||||||
e.stopPropagation();
|
|
||||||
}
|
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { attachment, index, size, standalone, letterbox, displayWidth } = this.props;
|
const { attachment, index, size, standalone, letterbox, displayWidth } = this.props;
|
||||||
|
|
||||||
|
@ -190,7 +185,6 @@ class Item extends React.PureComponent {
|
||||||
onClick={this.handleClick}
|
onClick={this.handleClick}
|
||||||
onMouseEnter={this.handleMouseEnter}
|
onMouseEnter={this.handleMouseEnter}
|
||||||
onMouseLeave={this.handleMouseLeave}
|
onMouseLeave={this.handleMouseLeave}
|
||||||
onMouseDown={this.handleMouseDown}
|
|
||||||
autoPlay={autoPlay}
|
autoPlay={autoPlay}
|
||||||
loop
|
loop
|
||||||
muted
|
muted
|
||||||
|
|
|
@ -40,7 +40,7 @@ export default class ModalRoot extends React.PureComponent {
|
||||||
this.setState({ revealed: false });
|
this.setState({ revealed: false });
|
||||||
}
|
}
|
||||||
if (!nextProps.children && !!this.props.children) {
|
if (!nextProps.children && !!this.props.children) {
|
||||||
this.activeElement.focus();
|
this.activeElement.focus({ preventScroll: true });
|
||||||
this.activeElement = null;
|
this.activeElement = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -147,6 +147,7 @@
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
object-fit: contain;
|
object-fit: contain;
|
||||||
|
user-select: none;
|
||||||
|
|
||||||
&:not(.letterbox) {
|
&:not(.letterbox) {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
Loading…
Reference in New Issue