Skip to content

Commit 4cc75f5

Browse files
committed
add style to FormControl
1 parent a6fb07e commit 4cc75f5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/react/src/FormControl/FormControl.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,11 @@ export type FormControlProps = {
4040
*/
4141
layout?: 'horizontal' | 'vertical'
4242
className?: string
43+
style?: React.CSSProperties
4344
}
4445

4546
const FormControl = React.forwardRef<HTMLDivElement, FormControlProps>(
46-
({children, disabled: disabledProp, layout = 'vertical', id: idProp, required, className}, ref) => {
47+
({children, disabled: disabledProp, layout = 'vertical', id: idProp, required, className, style}, ref) => {
4748
const [slots, childrenWithoutSlots] = useSlots(children, {
4849
caption: FormControlCaption,
4950
label: FormControlLabel,
@@ -170,6 +171,7 @@ const FormControl = React.forwardRef<HTMLDivElement, FormControlProps>(
170171
ref={ref}
171172
data-has-leading-visual={slots.leadingVisual ? '' : undefined}
172173
className={clsx(className, classes.ControlHorizontalLayout)}
174+
style={style}
173175
>
174176
{InputChildren}
175177
</div>
@@ -178,6 +180,7 @@ const FormControl = React.forwardRef<HTMLDivElement, FormControlProps>(
178180
ref={ref}
179181
data-has-label={!isLabelHidden ? '' : undefined}
180182
className={clsx(className, classes.ControlVerticalLayout)}
183+
style={style}
181184
>
182185
{slots.label}
183186
{React.isValidElement(InputComponent) &&

0 commit comments

Comments
 (0)