From efcb98730416c7efc8c339304580a864f92a29b6 Mon Sep 17 00:00:00 2001 From: Christian Hartmann Date: Fri, 12 Jun 2026 11:34:36 +0200 Subject: [PATCH] fix: validation error shown in NcNoteCard for QuestionShort also add missing aria error handling Signed-off-by: Christian Hartmann --- playwright/support/sections/SubmitSection.ts | 2 + src/components/Questions/QuestionColor.vue | 2 + src/components/Questions/QuestionDate.vue | 2 + src/components/Questions/QuestionDropdown.vue | 2 + src/components/Questions/QuestionFile.vue | 4 +- .../Questions/QuestionLinearScale.vue | 2 + src/components/Questions/QuestionLong.vue | 2 + src/components/Questions/QuestionRanking.vue | 4 +- src/components/Questions/QuestionShort.vue | 56 ++++++++++--------- 9 files changed, 47 insertions(+), 29 deletions(-) diff --git a/playwright/support/sections/SubmitSection.ts b/playwright/support/sections/SubmitSection.ts index a23e0e097..4f6f5edcd 100644 --- a/playwright/support/sections/SubmitSection.ts +++ b/playwright/support/sections/SubmitSection.ts @@ -46,6 +46,8 @@ export class SubmitSection { ): Promise { const question = this.getQuestion(questionName) await question.getByRole('textbox').fill(value) + // Wait for the debounced input handler to fire (INPUT_DEBOUNCE_MS = 400ms) + await this.page.waitForTimeout(500) } /** diff --git a/src/components/Questions/QuestionColor.vue b/src/components/Questions/QuestionColor.vue index 2655cb1b9..89f45b7bc 100644 --- a/src/components/Questions/QuestionColor.vue +++ b/src/components/Questions/QuestionColor.vue @@ -19,6 +19,8 @@ :modelValue="pickedColor" advancedFields :aria-required="isRequired" + :aria-errormessage="hasError ? errorId : undefined" + :aria-invalid="hasError ? 'true' : undefined" @update:modelValue="onUpdatePickedColor"> {{ colorPickerPlaceholder }} diff --git a/src/components/Questions/QuestionDate.vue b/src/components/Questions/QuestionDate.vue index e4e5aa1f3..087cf0b02 100644 --- a/src/components/Questions/QuestionDate.vue +++ b/src/components/Questions/QuestionDate.vue @@ -97,6 +97,8 @@ :disabledDate="disabledDates" :disabledTime="disabledTimes" :aria-required="isRequired" + :aria-errormessage="hasError ? errorId : undefined" + :aria-invalid="hasError ? 'true' : undefined" clearable @update:modelValue="onValueChange" /> diff --git a/src/components/Questions/QuestionDropdown.vue b/src/components/Questions/QuestionDropdown.vue index e937a79a3..4e3ea9a4e 100644 --- a/src/components/Questions/QuestionDropdown.vue +++ b/src/components/Questions/QuestionDropdown.vue @@ -41,6 +41,8 @@ :searchable="false" label="text" :aria-label-combobox="selectOptionPlaceholder" + :aria-errormessage="hasError ? errorId : undefined" + :aria-invalid="hasError ? 'true' : undefined" @invalid.prevent="validate" @update:modelValue="onInput" /> diff --git a/src/components/Questions/QuestionFile.vue b/src/components/Questions/QuestionFile.vue index bfca0c56b..e6dda6b06 100644 --- a/src/components/Questions/QuestionFile.vue +++ b/src/components/Questions/QuestionFile.vue @@ -111,7 +111,9 @@ class="question__input-wrapper" role="group" :aria-labelledby="titleId" - :aria-describedby="description ? descriptionId : undefined"> + :aria-describedby="description ? descriptionId : undefined" + :aria-errormessage="hasError ? errorId : undefined" + :aria-invalid="hasError ? 'true' : undefined">