From c2d306bf63dde0a9bad8b02cf06a3bcd32c34103 Mon Sep 17 00:00:00 2001 From: Andy Lai Date: Thu, 11 Apr 2024 21:48:27 +0800 Subject: [PATCH 1/3] [@mantine/core] ScrollArea: Fix incorrect inset position of the horizontal scrollbar (#6059) --- .../core/src/components/ScrollArea/ScrollArea.module.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/@mantine/core/src/components/ScrollArea/ScrollArea.module.css b/packages/@mantine/core/src/components/ScrollArea/ScrollArea.module.css index 5da40d6c2e4..2c0f4972e68 100644 --- a/packages/@mantine/core/src/components/ScrollArea/ScrollArea.module.css +++ b/packages/@mantine/core/src/components/ScrollArea/ScrollArea.module.css @@ -81,8 +81,8 @@ height: var(--scrollarea-scrollbar-size); flex-direction: column; bottom: 0; - inset-inline-end: 0; - inset-inline-start: var(--sa-corner-height); + inset-inline-start: 0; + inset-inline-end: var(--sa-corner-width); } } From 981bf601ce767320fcdab63d11d3e703353bb4f1 Mon Sep 17 00:00:00 2001 From: zo-ly Date: Thu, 11 Apr 2024 21:48:56 +0800 Subject: [PATCH 2/3] [@mantine/core] ScrollArea: Fix `viewportProps.onScroll` not working (#6055) --- .../core/src/components/ScrollArea/ScrollArea.tsx | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/packages/@mantine/core/src/components/ScrollArea/ScrollArea.tsx b/packages/@mantine/core/src/components/ScrollArea/ScrollArea.tsx index 4c980033c35..d00ee4b9997 100644 --- a/packages/@mantine/core/src/components/ScrollArea/ScrollArea.tsx +++ b/packages/@mantine/core/src/components/ScrollArea/ScrollArea.tsx @@ -134,15 +134,10 @@ export const ScrollArea = factory((_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} From 77692dea145f6900fb6feaf0e0e7b102f43d69fc Mon Sep 17 00:00:00 2001 From: stu <36813890+s-cork@users.noreply.github.com> Date: Thu, 11 Apr 2024 21:49:39 +0800 Subject: [PATCH 3/3] [@mantine/core] PinInput: Add `rootRef` prop support (#6032) --- packages/@mantine/core/src/components/PinInput/PinInput.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/@mantine/core/src/components/PinInput/PinInput.tsx b/packages/@mantine/core/src/components/PinInput/PinInput.tsx index 1628fdfc8f4..f31c98d5f29 100644 --- a/packages/@mantine/core/src/components/PinInput/PinInput.tsx +++ b/packages/@mantine/core/src/components/PinInput/PinInput.tsx @@ -116,6 +116,9 @@ export interface PinInputProps /** Props passed down to the hidden input */ hiddenInputProps?: React.ComponentPropsWithoutRef<'input'>; + + /** Assigns ref of the root element */ + rootRef?: React.ForwardedRef; } export type PinInputFactory = Factory<{ @@ -174,6 +177,7 @@ export const PinInput = factory((props, ref) => { vars, id, hiddenInputProps, + rootRef, ...others } = useProps('PinInput', defaultProps, props); @@ -364,6 +368,7 @@ export const PinInput = factory((props, ref) => {