Skip to content

Commit

Permalink
Fixed: File browser
Browse files Browse the repository at this point in the history
(cherry picked from commit f7ce5c7b115ea0d12ab63f19960c473e09e30f3d)
  • Loading branch information
markus101 authored and mynameisbogdan committed May 5, 2023
1 parent 5bc1f34 commit 8090dc9
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions frontend/src/Components/FileBrowser/FileBrowserModalContent.js
Expand Up @@ -39,7 +39,7 @@ class FileBrowserModalContent extends Component {
constructor(props, context) {
super(props, context);

this._scrollerNode = null;
this._scrollerRef = React.createRef();

this.state = {
isFileBrowserModalOpen: false,
Expand All @@ -57,21 +57,10 @@ class FileBrowserModalContent extends Component {
currentPath !== prevState.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

Expand Down Expand Up @@ -145,7 +134,7 @@ class FileBrowserModalContent extends Component {
/>

<Scroller
ref={this.setScrollerRef}
ref={this._scrollerRef}
className={styles.scroller}
scrollDirection={scrollDirections.BOTH}
>
Expand Down

0 comments on commit 8090dc9

Please sign in to comment.