mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-11 07:37:10 -07:00
Fixed: File browser
(cherry picked from commit f7ce5c7b115ea0d12ab63f19960c473e09e30f3d)
This commit is contained in:
parent
fe0abd527e
commit
24056fd052
1 changed files with 3 additions and 15 deletions
|
@ -1,6 +1,5 @@
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import ReactDOM from 'react-dom';
|
|
||||||
import Alert from 'Components/Alert';
|
import Alert from 'Components/Alert';
|
||||||
import PathInput from 'Components/Form/PathInput';
|
import PathInput from 'Components/Form/PathInput';
|
||||||
import Button from 'Components/Link/Button';
|
import Button from 'Components/Link/Button';
|
||||||
|
@ -39,7 +38,7 @@ class FileBrowserModalContent extends Component {
|
||||||
constructor(props, context) {
|
constructor(props, context) {
|
||||||
super(props, context);
|
super(props, context);
|
||||||
|
|
||||||
this._scrollerNode = null;
|
this._scrollerRef = React.createRef();
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
isFileBrowserModalOpen: false,
|
isFileBrowserModalOpen: false,
|
||||||
|
@ -57,21 +56,10 @@ class FileBrowserModalContent extends Component {
|
||||||
currentPath !== prevState.currentPath
|
currentPath !== prevState.currentPath
|
||||||
) {
|
) {
|
||||||
this.setState({ currentPath });
|
this.setState({ currentPath });
|
||||||
this._scrollerNode.scrollTop = 0;
|
this._scrollerRef.current.scrollTop = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// Control
|
|
||||||
|
|
||||||
setScrollerRef = (ref) => {
|
|
||||||
if (ref) {
|
|
||||||
this._scrollerNode = ReactDOM.findDOMNode(ref);
|
|
||||||
} else {
|
|
||||||
this._scrollerNode = null;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Listeners
|
// Listeners
|
||||||
|
|
||||||
|
@ -143,7 +131,7 @@ class FileBrowserModalContent extends Component {
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Scroller
|
<Scroller
|
||||||
ref={this.setScrollerRef}
|
ref={this._scrollerRef}
|
||||||
className={styles.scroller}
|
className={styles.scroller}
|
||||||
scrollDirection={scrollDirections.BOTH}
|
scrollDirection={scrollDirections.BOTH}
|
||||||
>
|
>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue