Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Rule RSRCH]: Group/Fieldset "XXX‬" has a duplicate name to another group - nested group behaviour #1859

Open
Mark-Falconbridge-i2 opened this issue Mar 4, 2024 · 4 comments
Labels
engine Issues in the accessibility-checker-engine component priority-2 (med) T61 user-reported Issues identified outside of the core team

Comments

@Mark-Falconbridge-i2
Copy link

Mark-Falconbridge-i2 commented Mar 4, 2024

Rule description

We have a UI with nested groups, the inner groups have unique labels within their parent group but they could be duplicated across groups.

Here is a simplified example of what I mean:

<div role="group" aria-label="outer 1">
  <div role="group" aria-label="inner 1">
  </div>
  <div role="group" aria-label="inner 2">
  </div>
</div>
<div role="group" aria-label="outer 2">
  <div role="group" aria-label="inner 1">
  </div>
</div>

The equal access checker will raise this as a violation as there are two groups with the label "inner 1".

If I use NVDA or similar it announces the group labels as I enter and leave each group.

The W3C spec states that groups can be nested but doesn't mention anything about labelling - https://www.w3.org/TR/wai-aria-1.2/#group.

Do you think the rule should be changed so that duplicates are only considered within the same parent scope?

Relevant requirement(s)

1.3.1 Info and Relationships, 3.3.2 Labels or Instructions

High-level approach and rule scope

No response

Ruleset and failure level

fieldset_label_valid: Groups with nested inputs must have unique accessible name
Violation Group/Fieldset does not have an accessible name
Violation Group/Fieldset "{0}" has a duplicate name to another group

fieldset_label_valid.ts

rulesets: [{ 
         "id": ["IBM_Accessibility", "WCAG_2_1", "WCAG_2_0", "WCAG_2_2"], 
         "num": ["1.3.1", "3.3.2"],
         "level": eRulePolicy.VIOLATION,
         "toolkitLevel": eToolkitLevel.LEVEL_THREE 
    act: [],

Failure level

"level": eRulePolicy.VIOLATION,

Different failure level

No response

Failure cases

No response

@marcjohlic marcjohlic added engine Issues in the accessibility-checker-engine component user-reported Issues identified outside of the core team labels Mar 4, 2024
@shunguoy shunguoy added the T61 label Mar 4, 2024
@philljenkins
Copy link
Contributor

philljenkins commented Mar 4, 2024

This may be required when the groups labelled inner-1 are the "same thing", the same links, or set of controls for example. Accessibility and user's expect that the same link text goes to the same place. I believe the intent of WCAG is that the label needs to be unique when it is in fact a different thing being labeled, but use the same label when it is the same thing.

I could think of several examples also where the same label is used in different parent contexts, such as Company address and Home address fields. The parent relationship should be considered as part of the calculated uniqueness.

I added the rule ID and messages to the issue description above

fieldset_label_valid: Groups with nested inputs must have unique accessible name
Violation Group/Fieldset does not have an accessible name
Violation Group/Fieldset "{0}" has a duplicate name to another group

fieldset_label_valid.ts

@shunguoy
Copy link
Contributor

shunguoy commented Mar 4, 2024

Triage: Phil to do: need a screen reader test to see if it announces the hierarchy of the labels.

@philljenkins
Copy link
Contributor

philljenkins commented Mar 6, 2024

Both JAWS and NVDA announce the parent of nested groups (append the parent's label with the child's label) that are not unique by themselves.

Using this newly modified test case file:
RPT Test Suite2.txt

JAWS & NVDA will read the outer and inner labels when navigating via tab into or navigating up (backward) into the groups. JAWS & NVDA do not "repeat" the inner or outer labels when the user remains inside the nested group/fieldset, as it should.

Navigating from top of test case file, JAWS speaks:

skip to main content same page link
Outer 1 Please enter
Inner 1 Please enter
Phone Phone Edit, enter phone id=phone, Type in text.

Navigating backward from bottom/end of test case file, JAWS speaks:

Outer 2 Please enter
Inner 1 Please enter
Address Edit, enter address id=cpaddress, Type in text.

@philljenkins
Copy link
Contributor

Additional issues will need to be opened for the other similar "..._label_unique rules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
engine Issues in the accessibility-checker-engine component priority-2 (med) T61 user-reported Issues identified outside of the core team
Projects
None yet
Development

No branches or pull requests

4 participants