Skip to content

fix(questions): let a corrected short answer submit right away - #4033

Open
AndyScherzinger wants to merge 1 commit into
mainfrom
fix/short-answer-submit-after-correction
Open

AndyScherzinger wants to merge 1 commit into
mainfrom
fix/short-answer-submit-after-correction

Conversation

@AndyScherzinger

Copy link
Copy Markdown
Member

A short answer with an input type (email, phone, number, regex) keeps its custom validity after an error until the debounced check runs 400 ms after the last keystroke. A respondent who corrects the answer and submits within that window gets nothing: the browser blocks the submit because of the stale custom validity, and no error is shown.

What changes

  • A short answer drops its custom validity as soon as it is edited. Submitting still runs validate() on every question, so an answer that is still invalid keeps the submit blocked and shows its error.

How to test

  1. Create a form with a short answer of input type Email address.
  2. Enter not an email, submit: the error shows.
  3. Correct it to a valid address and submit right away: the form is submitted on the first click (before, the click did nothing).

playwright/e2e/submit-form.spec.ts gets a test for this; it fails on main and passes with the fix. Checked in the logged-in app; the public link and embedded form use the same component.

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI (N/A)

A short answer kept its custom validity until the debounced check ran,
so submitting right after correcting an answer was silently blocked by
the browser. The answer now drops its custom validity as soon as it is
edited; submitting still validates every question.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant