From bfcef2126e308b3668c1a1545fd7bf4f70c2eed3 Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Thu, 26 Nov 2026 07:49:50 +0100 Subject: [PATCH] fix(questions): let a corrected short answer submit right away 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 --- playwright/e2e/submit-form.spec.ts | 24 ++++++++++++++++++++++ src/components/Questions/QuestionShort.vue | 1 + 2 files changed, 25 insertions(+) diff --git a/playwright/e2e/submit-form.spec.ts b/playwright/e2e/submit-form.spec.ts index 88ee16849..dcb1789af 100644 --- a/playwright/e2e/submit-form.spec.ts +++ b/playwright/e2e/submit-form.spec.ts @@ -510,3 +510,27 @@ test('Enter with the IME key code 229 keeps the focus in the answer', async ({ submitView.getQuestion('Country').getByRole('textbox'), ).toBeFocused() }) + +test('A corrected answer submits right away', async ({ page, submitView }) => { + const form = await api(page.request, 'POST', '/forms') + const question = await api(page.request, 'POST', `/forms/${form.id}/questions`, { + type: 'short', + text: 'Email', + }) + await api(page.request, 'PATCH', `/forms/${form.id}/questions/${question.id}`, { + keyValuePairs: { extraSettings: { validationType: 'email' } }, + }) + await page.goto(`apps/forms/${form.hash}/submit`) + + await submitView.fillText('Email', 'not an email') + await submitView.submitButton.click() + await expect( + submitView + .getQuestion('Email') + .getByText('The input is not a valid email address'), + ).toBeVisible() + + await submitView.fillText('Email', 'jane@example.com') + await submitView.submit() + await expect(submitView.successMessage).toBeVisible() +}) diff --git a/src/components/Questions/QuestionShort.vue b/src/components/Questions/QuestionShort.vue index a1d37916f..15033b374 100644 --- a/src/components/Questions/QuestionShort.vue +++ b/src/components/Questions/QuestionShort.vue @@ -229,6 +229,7 @@ export default defineComponent({ if (!field) { return } + field.setCustomValidity('') emit('update:values', [field.value]) void debounceValidate() }