Skip to content

Commit

Permalink
[@mantine/core] ScrollArea: Fix viewportProps.onScroll not working (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
zo-ly authored Apr 11, 2024
1 parent c2d306b commit 981bf60
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions packages/@mantine/core/src/components/ScrollArea/ScrollArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,10 @@ export const ScrollArea = factory<ScrollAreaFactory>((_props, ref) => {
ref={viewportRef}
data-offset-scrollbars={offsetScrollbars === true ? 'xy' : offsetScrollbars || undefined}
data-scrollbars={scrollbars || undefined}
onScroll={
typeof onScrollPositionChange === 'function'
? ({ currentTarget }) =>
onScrollPositionChange({
x: currentTarget.scrollLeft,
y: currentTarget.scrollTop,
})
: undefined
}
onScroll={(e) => {
viewportProps?.onScroll?.(e);
onScrollPositionChange?.({ x: e.currentTarget.scrollLeft, y: e.currentTarget.scrollTop });
}}
>
{children}
</ScrollAreaViewport>
Expand Down

0 comments on commit 981bf60

Please sign in to comment.