From ca873202c0b358bdfd6e267b5c806917159021a9 Mon Sep 17 00:00:00 2001 From: DuckieTM Date: Fri, 20 Jun 2025 10:51:06 +0200 Subject: [PATCH] :up Adding disable autoscroll --- src/common/InfiniteScroll.tsx | 8 +++++--- .../room/widgets/choosers/ChooserWidgetView.tsx | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/common/InfiniteScroll.tsx b/src/common/InfiniteScroll.tsx index 7a05c09..5f401bd 100644 --- a/src/common/InfiniteScroll.tsx +++ b/src/common/InfiniteScroll.tsx @@ -1,5 +1,5 @@ import { useVirtualizer } from '@tanstack/react-virtual'; -import { FC, Fragment, ReactElement, useEffect, useRef, useState } from 'react'; +import { FC, Fragment, ReactElement, useEffect, useRef } from 'react'; import { Base } from './Base'; import { UseMountEffect } from '../hooks'; @@ -50,7 +50,9 @@ export const InfiniteScroll: FC = props => UseMountEffect(() => { - setTimeout(() => scrollToIndex(scrollIndex), 0) + if (scrollToBottom) { + setTimeout(() => scrollToIndex(scrollIndex), 0); + } }); useEffect(() => @@ -90,4 +92,4 @@ export const InfiniteScroll: FC = props => style={ { minHeight: `${ paddingBottom }px` } } /> } ); -} +} \ No newline at end of file diff --git a/src/components/room/widgets/choosers/ChooserWidgetView.tsx b/src/components/room/widgets/choosers/ChooserWidgetView.tsx index 67c04cc..f11e63d 100644 --- a/src/components/room/widgets/choosers/ChooserWidgetView.tsx +++ b/src/components/room/widgets/choosers/ChooserWidgetView.tsx @@ -189,7 +189,8 @@ export const ChooserWidgetView: FC = props => ); - } } + } } + scrollToBottom={ false } /> { pickallFurni && (