From d74cc52098758c4f829ca373c286f9b782794c5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Wed, 11 Sep 2024 22:39:18 +0200 Subject: [PATCH] pl-fe: workaround for thread scroll position MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- .../pl-fe/src/features/status/components/thread.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/pl-fe/src/features/status/components/thread.tsx b/packages/pl-fe/src/features/status/components/thread.tsx index e03ce37c3c..760a727e3b 100644 --- a/packages/pl-fe/src/features/status/components/thread.tsx +++ b/packages/pl-fe/src/features/status/components/thread.tsx @@ -299,7 +299,15 @@ const Thread: React.FC = ({ offset: -146, }); - setTimeout(() => statusRef.current?.querySelector('.detailed-actualStatus')?.focus(), 0); + // TODO: Actually fix this + setTimeout(() => { + scroller.current?.scrollToIndex({ + index: ancestorsIds.size, + offset: -146, + }); + + setTimeout(() => statusRef.current?.querySelector('.detailed-actualStatus')?.focus(), 0); + }, 0); }, [status.id, ancestorsIds.size]); const handleOpenCompareHistoryModal = (status: Pick) => {