From 98b38782312ff46772bc5835b527c128bc3fb467 Mon Sep 17 00:00:00 2001 From: Sven Grossmann Date: Tue, 15 Aug 2023 13:18:19 +0200 Subject: [PATCH] Logs: Fix scrolling with `exploreScrollableLogsContainer` feature (#73272) fix scrolling with `exploreScrollableLogsContainer` --- public/app/features/explore/Logs/Logs.tsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/public/app/features/explore/Logs/Logs.tsx b/public/app/features/explore/Logs/Logs.tsx index 2cf73968220..d79e51dd445 100644 --- a/public/app/features/explore/Logs/Logs.tsx +++ b/public/app/features/explore/Logs/Logs.tsx @@ -454,7 +454,18 @@ class UnthemedLogs extends PureComponent { 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 {