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 {
2626 maxLength ?: number ;
2727 'data-testid' ?: string ;
2828 w ?: Sx [ 'w' ] ;
29+ onFormSubmit ?: ( event : Readonly < React . FormEvent < HTMLFormElement > > ) => void ;
2930}
3031
3132export const TextBox = ( {
@@ -42,9 +43,10 @@ export const TextBox = ({
4243 containerStyle,
4344 maxLength,
4445 w = '$auto' ,
46+ onFormSubmit,
4547 ...rest
4648} : Readonly < TextBoxProps > ) : JSX . Element => (
47- < Form . Root >
49+ < Form . Root onSubmit = { onFormSubmit } >
4850 < Flex justifyContent = "space-between" alignItems = "center" >
4951 < Form . Field
5052 name = "field"
Original file line number Diff line number Diff line change @@ -58,6 +58,9 @@ export const Overview = (): JSX.Element => {
5858 onChange = { ( event ) : void => {
5959 setValue ( event . target . value ) ;
6060 } }
61+ onFormSubmit = { ( event ) : void => {
62+ event . preventDefault ( ) ;
63+ } }
6164 />
6265 </ Flex >
6366 </ Section >
You can’t perform that action at this time.
0 commit comments