From 3216b3662f5119bf1c69541978f3a12d281c08ea Mon Sep 17 00:00:00 2001 From: tamago324 Date: Mon, 16 Dec 2024 14:42:30 +0900 Subject: [PATCH] [@mantine/core] ScrollArea: Fix scrollbar not changing with the scroll position on first render (#7257, #7260) --- .../components/ScrollArea/ScrollAreaThumb/ScrollAreaThumb.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/@mantine/core/src/components/ScrollArea/ScrollAreaThumb/ScrollAreaThumb.tsx b/packages/@mantine/core/src/components/ScrollArea/ScrollAreaThumb/ScrollAreaThumb.tsx index 8f5410fb68..650b0deed4 100644 --- a/packages/@mantine/core/src/components/ScrollArea/ScrollAreaThumb/ScrollAreaThumb.tsx +++ b/packages/@mantine/core/src/components/ScrollArea/ScrollAreaThumb/ScrollAreaThumb.tsx @@ -1,6 +1,5 @@ import { forwardRef, useEffect, useRef } from 'react'; import { useDebouncedCallback, useMergedRef } from '@mantine/hooks'; -import { noop } from '../../../core'; import { useScrollAreaContext } from '../ScrollArea.context'; import { useScrollbarContext } from '../ScrollAreaScrollbar/Scrollbar.context'; import { addUnlinkedScrollListener, composeEventHandlers } from '../utils'; @@ -13,7 +12,7 @@ export const Thumb = forwardRef((props, forwardedRef const scrollbarContext = useScrollbarContext(); const { onThumbPositionChange } = scrollbarContext; const composedRef = useMergedRef(forwardedRef, (node) => scrollbarContext.onThumbChange(node)); - const removeUnlinkedScrollListenerRef = useRef<(() => void) | undefined>(noop); + const removeUnlinkedScrollListenerRef = useRef<(() => void) | undefined>(undefined); const debounceScrollEnd = useDebouncedCallback(() => { if (removeUnlinkedScrollListenerRef.current) { removeUnlinkedScrollListenerRef.current();