Skip to content

Commit 2014326

Browse files
authored
Merge pull request #488 from mashmatrix/support-slds-2-form
Update `Form` for SLDS2
2 parents 4cb3806 + 65b5886 commit 2014326

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/scripts/Form.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { FC, FormHTMLAttributes } from 'react';
1+
import React, { FC, HTMLAttributes } from 'react';
22
import classnames from 'classnames';
33
import { FormElement } from './FormElement';
44

@@ -7,7 +7,7 @@ import { FormElement } from './FormElement';
77
*/
88
export type FormProps = {
99
type?: 'stacked' | 'horizontal' | 'inline' | 'compound';
10-
} & FormHTMLAttributes<HTMLFormElement>;
10+
} & HTMLAttributes<HTMLDivElement>;
1111

1212
/**
1313
*
@@ -16,7 +16,7 @@ export const Form: FC<FormProps> = (props) => {
1616
const { className, type = 'stacked', children, ...rprops } = props;
1717
const formClassNames = classnames(className, `slds-form_${type}`);
1818
return (
19-
<form className={formClassNames} {...rprops}>
19+
<div className={formClassNames} {...rprops}>
2020
{React.Children.map(children, (child) => {
2121
if (
2222
React.isValidElement(child) &&
@@ -26,6 +26,6 @@ export const Form: FC<FormProps> = (props) => {
2626
}
2727
return child;
2828
})}
29-
</form>
29+
</div>
3030
);
3131
};

0 commit comments

Comments
 (0)