Logs: Fix scrolling with exploreScrollableLogsContainer feature (#73272)

fix scrolling with `exploreScrollableLogsContainer`
This commit is contained in:
Sven Grossmann 2023-08-15 13:18:19 +02:00 committed by GitHub
parent 57d8997b86
commit 98b3878231
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -454,7 +454,18 @@ class UnthemedLogs extends PureComponent<Props, State> {
return { from: firstTimeStamp, to: lastTimeStamp };
});
scrollToTopLogs = () => this.topLogsRef.current?.scrollIntoView();
scrollToTopLogs = () => {
if (config.featureToggles.exploreScrollableLogsContainer) {
if (this.logsContainer.current) {
this.logsContainer.current.scroll({
behavior: 'auto',
top: 0,
});
}
} else {
this.topLogsRef.current?.scrollIntoView();
}
};
render() {
const {