[v10.1.x] Logs: Fix scrolling with exploreScrollableLogsContainer feature (#73276)

Logs: Fix scrolling with `exploreScrollableLogsContainer` feature (#73272)

fix scrolling with `exploreScrollableLogsContainer`

(cherry picked from commit 98b3878231)

Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>
This commit is contained in:
grafana-delivery-bot[bot]
2023-08-15 14:32:00 +03:00
committed by GitHub
co-authored by Sven Grossmann
parent b8556eab5f
commit 243a50ffd3
+12 -1
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 {