1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Disable smooth scrolling

Signed-off-by: alexfront <alex.andreev.email@gmail.com>
This commit is contained in:
alexfront 2022-09-09 11:04:24 +03:00
parent e82f83fa5a
commit aeb0127a8f

View File

@ -29,12 +29,14 @@ export const LogList = observer(({ model }: LogListProps) => {
const topLineRef = useRef<HTMLDivElement>(null); const topLineRef = useRef<HTMLDivElement>(null);
const bottomLineRef = useRef<HTMLDivElement>(null); const bottomLineRef = useRef<HTMLDivElement>(null);
const [toBottomVisible, setButtonVisibility] = useJumpToBottomButton(parentRef.current); const [toBottomVisible, setButtonVisibility] = useJumpToBottomButton(parentRef.current);
const uniqRowKey = useRefreshListOnDataChange(model.logTabData.get());
const rowVirtualizer = useVirtualizer({ const rowVirtualizer = useVirtualizer({
count: visibleLogs.get().length, count: visibleLogs.get().length,
getScrollElement: () => parentRef.current, getScrollElement: () => parentRef.current,
estimateSize: () => 38, estimateSize: () => 38,
overscan: 5, overscan: 5,
enableSmoothScroll: false,
}); });
const scrollTo = (index: number) => { const scrollTo = (index: number) => {
@ -52,13 +54,8 @@ export const LogList = observer(({ model }: LogListProps) => {
}; };
useInitialScrollToBottom(model, scrollToBottom); useInitialScrollToBottom(model, scrollToBottom);
const uniqRowKey = useRefreshListOnDataChange(model.logTabData.get());
useScrollOnSearch(model.searchStore, scrollTo); useScrollOnSearch(model.searchStore, scrollTo);
useStickToBottomOnLogsLoad({ bottomLineRef, model, scrollToBottom }); useStickToBottomOnLogsLoad({ bottomLineRef, model, scrollToBottom });
useOnScrollTop({ topLineRef, model, scrollTo }); useOnScrollTop({ topLineRef, model, scrollTo });
return ( return (