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: 'color-contrast' rule fails disabled control's label added using "aria-describedby" attribute #4406

Open
1 task done
adrianaferrugento opened this issue Apr 11, 2024 · 5 comments
Labels
color contrast Color contrast issues fix Bug fixes rules Issue or false result from an axe-core rule

Comments

@adrianaferrugento
Copy link

Product

axe-core

Product Version

4.9.0

Latest Version

  • I have tested the issue with the latest version of the product

Issue Description

Same as 2090, but here the label is added using aria-describedby attribute

Per WCAG 1.4.3 the text that is part of an inactive user interface component do not have contrast requirement.

Incidental: Text or images of text that are part of an inactive user interface component, that are pure decoration, that are not visible to anyone, or that are part of a picture that contains significant other visual content, have no contrast requirement.

Expectation

'color-contrast' would not fail for labels related to disabled controls

Actual

'color-contrast' rule fails for a label( added using aria-describedby attribute) of a disabled control

How to Reproduce

Screenshot 2024-04-11 at 16 28 26

@adrianaferrugento adrianaferrugento added the ungroomed Ticket needs a maintainer to prioritize and label label Apr 11, 2024
@straker
Copy link
Contributor

straker commented Apr 11, 2024

Thanks for the issue. From the screenshot I believe the issue is that the input element is not truly disabled. If you'd like to disable it you'll need to use disabled or aria-disabled=true, as data-disabled is not recognized by the browser as disabling the input.

@adrianaferrugento
Copy link
Author

Hi @straker, thank you for the quick reply! Our textarea element does have disabled set on it and it still doesn't recognise the aria-describedby element as being part of that component.

@straker
Copy link
Contributor

straker commented Apr 11, 2024

Gotcha. I see what you mean. I'll have to ask the team about what should happen in these cases. I'll let you know when I get an answer.

@adrianaferrugento
Copy link
Author

Amazing, thank you!

@WilcoFiers
Copy link
Contributor

I agree with @adrianaferrugento on this one. There's a very good chance that if a control is disabled, things related to that control are not intended to be used. Ignoring an element referenced with aria-describedby feels reasonable. I'd say aria-errormessage and aria-controls should get that treatment too.

I think we should consider going a step further than that even and try to identify the container group (fieldset, radiogroup, etc), if all controls in a group are disabled, all text in it can be skipped in contrast testing. Either that or we set it as needs review. We'll look at that when we get to fixing this.

@WilcoFiers WilcoFiers added fix Bug fixes rules Issue or false result from an axe-core rule color contrast Color contrast issues and removed ungroomed Ticket needs a maintainer to prioritize and label labels Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
color contrast Color contrast issues fix Bug fixes rules Issue or false result from an axe-core rule
Projects
None yet
Development

No branches or pull requests

3 participants