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

False Positive: Multiple <label>s marked as errors #1759

Closed
aardrian opened this issue Aug 8, 2019 · 8 comments
Closed

False Positive: Multiple <label>s marked as errors #1759

aardrian opened this issue Aug 8, 2019 · 8 comments
Assignees
Labels
docs Documentation changes fix Bug fixes rules Issue or false result from an axe-core rule
Milestone

Comments

@aardrian
Copy link

aardrian commented Aug 8, 2019

Expectation: For a field with with multiple <label> elements, Axe flags it as a warning (using should language).

Actual: When Axe encounters a field with with multiple <label> elements, it flags this as an error (using must language).

Motivation: Because it generates false positives.

To Reproduce:

  1. Go to https://s.codepen.io/aardrian/debug/WVJvjM
  2. Inspect the page with Axe extension.
  3. View the Violations found column.

Sample Code:

<form>
  <label for="a">ham</label>
  <input type="text" id="a">
  <label for="a">bone</label>
</form>

Why Axe Does This:
The Deque page explaining this rule confirms this is considered a failure, suggesting this is not a software bug:

  • Statement: "Form fields do not have duplicate labels"
  • Statement: "Ensure that only one label is assigned to a form field."
  • The following compliance data is included on the page:

Requirement(s)

  • WCAG 2.1 (A): MUST
  • WCAG 2.0 (A): MUST
  • Section 508: MUST

WCAG Success Criteria

  • 3.3.2 Labels or Instructions

Section 508 Guidelines

  • 1194.22 (n) Information required to complete electronic forms online

Why I Think Axe Should Not:

Testing tool comparison:
The three tools I see most in use all flag this as an error.

  • Axe: must implies error: "Form field must not have multiple label elements" (as 3.3.2),
  • WAVE: Error: "A form control has more than one label associated with it." (as 1.1.1, 1.3.1, 2.4.6, 3.3.2),
  • ARC: "Error: multiple form labels used".

Alternate Outcome:
You tell me I am a wrong wrongerson and tell me to bugger off.

@straker straker added fix Bug fixes rules Issue or false result from an axe-core rule labels Aug 14, 2019
@straker straker added this to the Axe-core 3.4 milestone Aug 14, 2019
@straker
Copy link
Contributor

straker commented Aug 14, 2019

Thanks for all the information. We've decided to mark the rule as "needs review" instead of failures since if all the needed information is in the first label it should be fine. However, we still think it's a wcag failure.

@jeankaplansky we also agree that the docs should be updated to use SHOULD instead of MUST for the wcag requirements.

@jeankaplansky
Copy link
Contributor

See rule help ID: form-field-multiple-labels

@jeankaplansky jeankaplansky added the docs Documentation changes label Sep 11, 2019
@jeankaplansky
Copy link
Contributor

Nothing to update after all.

@chandana7393
Copy link

Tested, working as expected
multiple_label_must_should

Tested Environment:.
Axe-coconut - 4.0.0.29404v
Chrome - 77.0.3865.120v
OS - Windows 10 64 bit.

@patrickhulce
Copy link

Hi there! Quick question on the documentation around this issue. In #1759 (comment) it was stated that the docs should change from MUST to SHOULD, currently I'm seeing MUST in the Section 508 in the 3.4 docs, but #1759 (comment) stated there was nothing to update. Am I missing something?

Is it the position of axe-core that this is not a failure/could be flaky and is a SHOULD across the board? I ask because we're discussing how to handle this in Lighthouse at the moment now that it will never fail. Our current inclination is to remove it from Lighthouse entirely if it's a "we're not sure" sort of issue, does this line up with your expectations?

@AutoSponge
Copy link
Contributor

@aardrian The original issue #689 had this helpful table in the comments, https://codepen.io/straker/pen/PvqONy. You can have multiple labels but there are only a few techniques that will work consistently across browser/AT combinations. In looking up that table I noticed this thread, so I wanted to cross-ref them for my future self.

@straker
Copy link
Contributor

straker commented Mar 11, 2020

Sorry @patrickhulce, I must have missed your comment. Reopening the ticket and we'll update the docs to use should (thanks @AutoSponge for commenting so I found this again)

@straker straker reopened this Mar 11, 2020
@jeeyyy
Copy link
Contributor

jeeyyy commented Mar 16, 2020

Relevant docs has been updated - https://dequeuniversity.com/rules/axe/3.5/form-field-multiple-labels

@jeeyyy jeeyyy closed this as completed Mar 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation changes fix Bug fixes rules Issue or false result from an axe-core rule
Projects
None yet
Development

No branches or pull requests

7 participants