mirror of https://github.com/Radarr/Radarr
Fixed: File browser
(cherry picked from commit f7ce5c7b115ea0d12ab63f19960c473e09e30f3d)
This commit is contained in:
parent
2d96c308f0
commit
c2736bbe27
|
@ -39,7 +39,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 +57,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
|
||||||
|
|
||||||
|
@ -145,7 +134,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…
Reference in New Issue