Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -37,17 +42,17 @@ export function TextInputComponent(props: TextInputComponentProps) {
<Styled.FormToSendUrlItem
style={styleOfLabelInPreviewMode}
as="label"
htmlFor="link-receiver"
htmlFor={inputId}
>
<Styled.LabelForm>
{label}
</Styled.LabelForm>
<div style={styleOfPreviewButtonWrapper}>
<Styled.LabelFormTextInput
id="link-receiver"
id={inputId}
value={url}
type="text"
name="link"
name={inputName}
placeholder="https://..."
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
setPreviousModalState((p) => {
Expand Down
Loading