Skip to content

Commit

Permalink
fix: Scroll position is preserved when re-opening the same class in d…
Browse files Browse the repository at this point in the history
…ata browser via navigation bar (parse-community#2445)
  • Loading branch information
AshishBarvaliya authored Jun 8, 2023
1 parent b1542ab commit 667675c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/dashboard/Data/Browser/BrowserTable.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ export default class BrowserTable extends React.Component {
} else if (this.props.ordering !== props.ordering) {
this.setState({ offset: 0 });
this.tableRef.current.scrollTop = 0;
} else if (this.props.filters.size !== props.filters.size) {
this.setState({ offset: 0 }, () => {
this.tableRef.current.scrollTop = 0;
});
}
}

Expand Down

0 comments on commit 667675c

Please sign in to comment.