File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
src/design-system/text-box Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ export interface TextBoxProps extends Form.FormControlProps {
26
26
maxLength ?: number ;
27
27
'data-testid' ?: string ;
28
28
w ?: Sx [ 'w' ] ;
29
+ onFormSubmit ?: ( event : Readonly < React . FormEvent < HTMLFormElement > > ) => void ;
29
30
}
30
31
31
32
export const TextBox = ( {
@@ -42,9 +43,10 @@ export const TextBox = ({
42
43
containerStyle,
43
44
maxLength,
44
45
w = '$auto' ,
46
+ onFormSubmit,
45
47
...rest
46
48
} : Readonly < TextBoxProps > ) : JSX . Element => (
47
- < Form . Root >
49
+ < Form . Root onSubmit = { onFormSubmit } >
48
50
< Flex justifyContent = "space-between" alignItems = "center" >
49
51
< Form . Field
50
52
name = "field"
Original file line number Diff line number Diff line change @@ -58,6 +58,9 @@ export const Overview = (): JSX.Element => {
58
58
onChange = { ( event ) : void => {
59
59
setValue ( event . target . value ) ;
60
60
} }
61
+ onFormSubmit = { ( event ) : void => {
62
+ event . preventDefault ( ) ;
63
+ } }
61
64
/>
62
65
</ Flex >
63
66
</ Section >
You can’t perform that action at this time.
0 commit comments