Skip to content

Commit 71b1ba1

Browse files
committed
Add input ref to Radio component
1 parent ea6c3dd commit 71b1ba1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/components/radios/components/Radio.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export interface RadioProps extends HTMLProps<HTMLInputElement> {
1111
conditional?: ReactNode;
1212
forceShowConditional?: boolean;
1313
conditionalWrapperProps?: HTMLProps<HTMLDivElement>;
14+
inputRef?: (inputRef: HTMLElement | null) => any;
1415
}
1516

1617
const Radio: React.FC<RadioProps> = ({
@@ -26,6 +27,7 @@ const Radio: React.FC<RadioProps> = ({
2627
checked,
2728
defaultChecked,
2829
onChange,
30+
inputRef,
2931
...rest
3032
}) => {
3133
const {
@@ -71,6 +73,7 @@ const Radio: React.FC<RadioProps> = ({
7173
aria-describedby={hint ? `${inputID}--hint` : undefined}
7274
checked={checked}
7375
defaultChecked={defaultChecked}
76+
ref={inputRef}
7477
{...rest}
7578
/>
7679
{children ? (

0 commit comments

Comments
 (0)