We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3d3aaec + 8c26e2b commit 98ad07eCopy full SHA for 98ad07e
src/design-system/text-box/text-box.component.tsx
@@ -26,6 +26,7 @@ export interface TextBoxProps extends Form.FormControlProps {
26
maxLength?: number;
27
'data-testid'?: string;
28
w?: Sx['w'];
29
+ onFormSubmit?: (event: Readonly<React.FormEvent<HTMLFormElement>>) => void;
30
}
31
32
export const TextBox = ({
@@ -42,9 +43,12 @@ export const TextBox = ({
42
43
containerStyle,
44
maxLength,
45
w = '$auto',
46
+ onFormSubmit = event => {
47
+ event.preventDefault();
48
+ },
49
...rest
50
}: Readonly<TextBoxProps>): JSX.Element => (
- <Form.Root>
51
+ <Form.Root onSubmit={onFormSubmit}>
52
<Flex justifyContent="space-between" alignItems="center">
53
<Form.Field
54
name="field"
0 commit comments