Skip to content

Commit

Permalink
[@mantine/core] ScrollArea: Fix scrollbar not changing with the scrol…
Browse files Browse the repository at this point in the history
…l position on first render (#7257, #7260)
  • Loading branch information
tamago324 authored Dec 16, 2024
1 parent c99a6b1 commit 3216b36
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -13,7 +12,7 @@ export const Thumb = forwardRef<HTMLDivElement, ThumbProps>((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();
Expand Down

0 comments on commit 3216b36

Please sign in to comment.