From 8c26e2b1d37318eabd5226bee56ee018357630f9 Mon Sep 17 00:00:00 2001 From: vetalcore Date: Mon, 26 May 2025 17:02:51 +0300 Subject: [PATCH] fix: add onsubmit form event handler for text box component --- src/design-system/text-box/text-box.component.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/design-system/text-box/text-box.component.tsx b/src/design-system/text-box/text-box.component.tsx index 4c3e33c..f83f1d7 100644 --- a/src/design-system/text-box/text-box.component.tsx +++ b/src/design-system/text-box/text-box.component.tsx @@ -26,6 +26,7 @@ export interface TextBoxProps extends Form.FormControlProps { maxLength?: number; 'data-testid'?: string; w?: Sx['w']; + onFormSubmit?: (event: Readonly>) => void; } export const TextBox = ({ @@ -42,9 +43,12 @@ export const TextBox = ({ containerStyle, maxLength, w = '$auto', + onFormSubmit = event => { + event.preventDefault(); + }, ...rest }: Readonly): JSX.Element => ( - +