From dd3d0c1eab4c58ab8bd5f9798ff4cb7ad166c89d Mon Sep 17 00:00:00 2001 From: mkljczk Date: Mon, 10 Mar 2025 12:28:44 +0100 Subject: [PATCH] pl-fe: improve virtual list positioning, i hate my life btw Signed-off-by: mkljczk --- packages/pl-fe/src/components/scrollable-list.tsx | 8 +++++++- packages/pl-fe/src/features/status/index.tsx | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/pl-fe/src/components/scrollable-list.tsx b/packages/pl-fe/src/components/scrollable-list.tsx index ee9a6c7b1..e8560a02b 100644 --- a/packages/pl-fe/src/components/scrollable-list.tsx +++ b/packages/pl-fe/src/components/scrollable-list.tsx @@ -120,7 +120,13 @@ const ScrollableList = React.forwardRef, IScrollableList>( useEffect(() => { if (showLoading) return; - if (typeof initialIndex === 'number') virtualizer.scrollToIndex(initialIndex); + if (typeof initialIndex === 'number') { + const targetIndex = (initialIndex === 0) ? initialIndex : initialIndex + 1; + virtualizer.scrollToIndex(targetIndex); + setTimeout(() => { + virtualizer.scrollToIndex(targetIndex); + }, 1); + } }, [showLoading, initialIndex]); useEffect(() => { diff --git a/packages/pl-fe/src/features/status/index.tsx b/packages/pl-fe/src/features/status/index.tsx index 8b5955df3..33911d7eb 100644 --- a/packages/pl-fe/src/features/status/index.tsx +++ b/packages/pl-fe/src/features/status/index.tsx @@ -104,7 +104,7 @@ const StatusDetails: React.FC = (props) => { - +