Axe-core: Disabled Button with child element triggering contrast violation

Created on 7 Nov 2016  ·  4Comments  ·  Source: dequelabs/axe-core

When running aXe on a

color contrast rules

Most helpful comment

All 4 comments

@mkivikoski asked about solving this on Twitter (thanks, Mike!).

Looks like the span is causing the false positive based on the node tree. The code controlling this can be found here: https://github.com/dequelabs/axe-core/blob/master/lib/rules/color-contrast-matches.js#L27

This could be solved by adding a little extra logic to check for child elements of the disabled button so they are also ignored with a false value, instead of letting it fall through to report about the span. It seems like whatever style was on that span would be irrelevant based on the parent element being disabled.

Whoa! Thanks for such a speedy response (and for putting it in the proper channel, my bad about that)!

Thanks for the direct link to the color-contrast-matches.js , super helpful, really appreciate it. 👍

I've fixed this internally, it will be a part of our next axe-core release. Stay tuned.

Was this page helpful?
0 / 5 - 0 ratings