From e5c13fb3c24552311f76e3ea4867ca2cd54eb534 Mon Sep 17 00:00:00 2001 From: Gustavo Trott Date: Fri, 23 Oct 2026 16:31:54 -0300 Subject: [PATCH] fix: sharing different URLs for presenter and viewers always fails as malformed Both URL inputs were rendered with name="link" and the same id, so with "Same URL for presenter and viewers" unchecked the submit handler read form.link as a RadioNodeList (empty value) and form.viewerLink as undefined, rejecting every link. Give each input its own name and id. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01GtQ5Bqwqnjb3mwv6RirFmg --- .../link-form/text-input/component.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/components/modal-to-share-link/link-form/text-input/component.tsx b/src/components/modal-to-share-link/link-form/text-input/component.tsx index a94c2e8..29e8343 100644 --- a/src/components/modal-to-share-link/link-form/text-input/component.tsx +++ b/src/components/modal-to-share-link/link-form/text-input/component.tsx @@ -22,6 +22,11 @@ export function TextInputComponent(props: TextInputComponentProps) { } else { label = 'Presenter URL: '; } + // Each input needs its own name and id: the submit handler reads them by name + // (`link` and `viewerLink`), and a shared name would turn `form.link` into a list + const inputName = isViewer ? 'viewerLink' : 'link'; + const inputId = isViewer ? 'viewer-link-receiver' : 'link-receiver'; + const styleOfLabelInPreviewMode: React.CSSProperties = !isUrlSameForRole ? { marginBottom: '1rem' } : null; @@ -37,17 +42,17 @@ export function TextInputComponent(props: TextInputComponentProps) { {label}
) => { setPreviousModalState((p) => {