Skip to content

Partner onboarding: Legal company name input becomes readOnly on validation error, permanently blocking signup #4234

Description

@timscheuerai

Bug

In the partner onboarding form, the Legal company name input is made readOnly whenever it has a validation error:

// apps/web/app/(ee)/partners.dub.co/(onboarding)/onboarding/onboarding-form.tsx:259
readOnly={!!partner?.companyName || !!errors.companyName}
{...register("companyName", {
  required: profileType === "company",
})}

Since the field is required when profileType === "company", submitting the form with it empty sets errors.companyName, which immediately flips the input to readOnly. The user can no longer type into it, so the error can never be cleared, so Continue can never succeed.

The onboarding form is unrecoverable from that state without a full page reload.

Steps to reproduce

  1. Go to partners.dub.co onboarding ("Create your partner profile")
  2. Set Profile Type to Company
  3. Leave Legal company name empty and click Continue
  4. The field now renders with both the red error border and the read-only grey background (read-only:bg-neutral-100 read-only:text-neutral-500), and rejects all input
  5. There is no way to proceed. Only a page reload recovers it.

Expected

A required-field validation error should leave the input editable so the user can actually fix it.

Suggested fix

readOnly should only express the "already set, not editable" case:

readOnly={!!partner?.companyName}

Notes

Hit by a real partner signing up to our program. They were fully blocked and assumed the platform was broken. Worth noting the deadlock is easy to fall into, because the natural reading of an empty required field is "click Continue and see what it wants".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions