Skip to content

Commit

Permalink
[@mantine/core] PinInput: Add rootRef prop support (#6032)
Browse files Browse the repository at this point in the history
  • Loading branch information
s-cork authored Apr 11, 2024
1 parent 981bf60 commit 77692de
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/@mantine/core/src/components/PinInput/PinInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<HTMLDivElement>;
}

export type PinInputFactory = Factory<{
Expand Down Expand Up @@ -174,6 +177,7 @@ export const PinInput = factory<PinInputFactory>((props, ref) => {
vars,
id,
hiddenInputProps,
rootRef,
...others
} = useProps('PinInput', defaultProps, props);

Expand Down Expand Up @@ -364,6 +368,7 @@ export const PinInput = factory<PinInputFactory>((props, ref) => {
<Group
{...others}
{...getStyles('root')}
ref={rootRef}
role="group"
id={uuid}
gap={gap}
Expand Down

0 comments on commit 77692de

Please sign in to comment.