-
Notifications
You must be signed in to change notification settings - Fork 791
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
Color contrast does not work when pointer-events: none is set on the element #318
Comments
I don't quite understand this issue. Are the items legitimate color contrast violations, but they aren't failing in axe-core because of Can you provide a demo for this issue? |
@marcysutton sure! The items are color contrast issues but aXe isn't marking them as failures. I created a code pen: https://codepen.io/rfleisch/pen/JNEzMP If you remove the pointer-events: none from the less you will see the failure when you run aXe, when you add it back in, you will not see the failure. |
Ah, yes that is reproducible–thanks for the quick reply. I bet From MDN:
Because of the ability to override on descendant elements, this seems valid from a high level. However, I question the interaction/accessibility implications for pointer-events: none on a label element; is there more to it than that? We exclude disabled elements, can you describe the use case some more for wide use of |
However, that does not mean that we should not try to fix this problem. |
@dylanb @marcysutton I looked into why we are using pointer-events:none on a label and it is because if a label overlaps with an input, a click event wasn't getting triggered on the input. |
@EXPErfleischmann you are still making the experience worse, you should rather fix the overlapping label problem |
pointer-events: none
is set on the element
pointer-events: none
is set on the element
Been digging a bit into this, and have a codepen demonstrating the issue:
This behavior is consistent across browsers, and is part of the spec. Since the spec uses hit testing to derive the stack,
Thinking about how we implement color contrast and talking with @straker, I'd be concerned about adding more expensive calcs to determine the background color since the color-contrast rule is already one of our slowest rules. I thought about trying to find elements with |
Temporarily setting: * {
pointer-events: all!important;
} Should allow us to ignore this issue. |
captured in release notes 2/03/2020 |
When using aXe on our site, the color contrast does not fail because the element has pointer-events:none set on the label. This makes it very hard to verify color contrast as we have pointer-events set to none in numerous places.
The text was updated successfully, but these errors were encountered: