From 9789cac53510b1a7252e961317a5983f807e043a Mon Sep 17 00:00:00 2001 From: dmitrykurmanov Date: Wed, 26 Jun 2024 17:14:18 +0400 Subject: [PATCH] work for the https://github.com/surveyjs/survey-library/issues/8460 --- src/question.ts | 2 +- src/question_checkbox.ts | 2 +- tests/markup/helper.ts | 2 ++ .../matrixdynamic-show-in-multiple-columns-mobile.snap.html | 4 ++-- .../matrixdynamic-show-in-multiple-columns.snap.html | 4 ++-- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/question.ts b/src/question.ts index dd778c4020..74caf55102 100644 --- a/src/question.ts +++ b/src/question.ts @@ -2674,7 +2674,7 @@ export class Question extends SurveyElement public get a11y_input_ariaRole(): string { return null; } - public get a11y_input_ariaRequired(): "true" | "false" | null { + public get a11y_input_ariaRequired(): "true" | "false" { return this.isRequired ? "true" : "false"; } public get a11y_input_ariaInvalid(): "true" | "false" { diff --git a/src/question_checkbox.ts b/src/question_checkbox.ts index 89e0be55c7..755c74aa55 100644 --- a/src/question_checkbox.ts +++ b/src/question_checkbox.ts @@ -661,7 +661,7 @@ export class QuestionCheckboxModel extends QuestionCheckboxBase { public get a11y_input_ariaRole(): string { return "group"; } - public get a11y_input_ariaRequired(): "true" | "false" | null { + public get a11y_input_ariaRequired(): "true" | "false" { return null; } // EO a11y diff --git a/tests/markup/helper.ts b/tests/markup/helper.ts index 46c206703e..052c0d8db6 100644 --- a/tests/markup/helper.ts +++ b/tests/markup/helper.ts @@ -330,6 +330,8 @@ function clearAttributes(el: Element, removeIds = false) { } if(el.hasAttribute("readonly")) el.setAttribute("readonly", ""); + if(el.hasAttribute("required")) + el.setAttribute("required", ""); if (el.hasAttribute("disabled")) el.setAttribute("disabled", ""); if(el.hasAttribute("ng-reflect-value")) { diff --git a/tests/markup/snapshots/matrixdynamic-show-in-multiple-columns-mobile.snap.html b/tests/markup/snapshots/matrixdynamic-show-in-multiple-columns-mobile.snap.html index 0de8a729c4..ef199282db 100644 --- a/tests/markup/snapshots/matrixdynamic-show-in-multiple-columns-mobile.snap.html +++ b/tests/markup/snapshots/matrixdynamic-show-in-multiple-columns-mobile.snap.html @@ -53,7 +53,7 @@ row row1, column col2