pl-fe: improve virtual list positioning, i hate my life btw

Signed-off-by: mkljczk <git@mkljczk.pl>
This commit is contained in:
mkljczk
2025-03-10 12:28:44 +01:00
parent 0c2927a522
commit dd3d0c1eab
2 changed files with 8 additions and 2 deletions

View File

@ -120,7 +120,13 @@ const ScrollableList = React.forwardRef<Virtualizer<any, any>, 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(() => {

View File

@ -104,7 +104,7 @@ const StatusDetails: React.FC<IStatusDetails> = (props) => {
<Stack space={4}>
<Column label={intl.formatMessage(titleMessage())}>
<PullToRefresh onRefresh={handleRefresh}>
<Thread status={status} />
<Thread key={status.id} status={status} />
</PullToRefresh>
</Column>