Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ac2936d

Browse files
fix(experiment-form-ui): prevent event bubbling from embedded form submission handlers (#9215)
1 parent 0335dcd commit ac2936d

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

web/src/features/evals/components/inner-evaluator-form.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1131,7 +1131,10 @@ export const InnerEvaluatorForm = (props: {
11311131
<Form {...form}>
11321132
<form
11331133
// eslint-disable-next-line @typescript-eslint/no-misused-promises
1134-
onSubmit={form.handleSubmit(onSubmit)}
1134+
onSubmit={(e) => {
1135+
e.stopPropagation(); // Prevent event bubbling to parent forms
1136+
form.handleSubmit(onSubmit)(e);
1137+
}}
11351138
onKeyDown={(e) => {
11361139
if (e.key === "Enter" && e.target instanceof HTMLInputElement) {
11371140
e.preventDefault();

web/src/features/public-api/components/CreateLLMApiKeyForm.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,10 @@ export function CreateLLMApiKeyForm({
475475
<Form {...form}>
476476
<form
477477
className={cn("flex flex-col gap-4 overflow-auto")}
478-
onSubmit={form.handleSubmit(onSubmit)}
478+
onSubmit={(e) => {
479+
e.stopPropagation(); // Prevent event bubbling to parent forms
480+
form.handleSubmit(onSubmit)(e);
481+
}}
479482
>
480483
<DialogBody>
481484
{/* LLM adapter */}

0 commit comments

Comments
 (0)