You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Ranking question: role="list" container without list items (aria-required-children) #3840
Describe the bug
In the submit view, a ranking question has a container with role="list" whose direct children are not list items. axe reports this as aria-required-children (critical, WCAG 1.3.1 Info and Relationships). Screen readers announce a list with no items, followed by unrelated content.
In src/components/Questions/QuestionRanking.vue, div.question__content has role="list". Its children are div.ranking-unranked and div.ranking-ranked, which hold their own <ul> (rendered by TransitionGroup tag="ul") and a label paragraph. The real lists are the inner <ul> elements, and the ranked items additionally set role="listitem" on <li>.
To Reproduce
Create a form with a ranking question with two or more options.
Open the form to answer it (/apps/forms/<hash>/submit).
Run axe on the page, or inspect the accessibility tree of the question.
axe reports aria-required-children on div.question__content.
Expected behavior
The outer container is not a list. role="group" keeps its aria-labelledby, aria-describedby, aria-errormessage and aria-invalid. The two inner <ul> elements stay the lists, and each one is named after its section ("Your ranking", and the unranked pool). The redundant role="listitem" on <li> can go.
Nextcloud (please complete the following information):
Nextcloud-Version: master
Forms-Version: main (5.5.0-dev)
Additional context
Found while reviewing #3123 (conditional questions). It is not caused by that PR: a top-level ranking question on main has the same problem.
Activity