From d0d1da6e7bab8185e0bdd0b60e8282e95dbafbec Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Fri, 2 Oct 2026 20:37:43 +0300 Subject: [PATCH] Stop submit bubbling out of every Dialog --- app/components/elements/Dialog.tsx | 2 + .../routes/to.$id.admin.registration.$tid.tsx | 25 +++++------ .../2026-10-02-friend-code-edit-profile.md | 5 +++ e2e/pages/user/user-edit-profile-page.ts | 11 +++++ e2e/sidebar-streams.spec.ts | 42 ++++++++++--------- e2e/user-page.spec.ts | 11 +++++ 6 files changed, 61 insertions(+), 35 deletions(-) create mode 100644 changelog/2026-10-02-friend-code-edit-profile.md diff --git a/app/components/elements/Dialog.tsx b/app/components/elements/Dialog.tsx index ee0d67afa..0fa3ff365 100644 --- a/app/components/elements/Dialog.tsx +++ b/app/components/elements/Dialog.tsx @@ -91,6 +91,8 @@ function DialogElement({ tabIndex={-1} closedby="closerequest" onClose={onClose} + // a portal doesn't stop React events from bubbling to an outer form + onSubmit={(e) => e.stopPropagation()} {...backdropPressHandlers} > {children} diff --git a/app/features/tournament-admin/routes/to.$id.admin.registration.$tid.tsx b/app/features/tournament-admin/routes/to.$id.admin.registration.$tid.tsx index ec7aa9542..39c8f87ff 100644 --- a/app/features/tournament-admin/routes/to.$id.admin.registration.$tid.tsx +++ b/app/features/tournament-admin/routes/to.$id.admin.registration.$tid.tsx @@ -381,21 +381,16 @@ function ImportTeamSection({ heading={t("forms:regImportTeam")} onClose={() => setIsOpen(false)} > - {/* The modal is portaled out of the registration