components icon indicating copy to clipboard operation
components copied to clipboard

MatDatepicker - WCAG 1.4.11 Issue

Open tleck1 opened this issue 3 years ago • 4 comments

Primary Date Color-Pass Secondary Date Color-Fail

Is this a regression?

  • [ ] Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

Present in all versions

Description

The color of the secondary date focus state indicator does not meet WCAG 1.4.11 requirements. It's currently at 1.6:1 and it needs to be 3:1 minimum.

https://www.w3.org/WAI/WCAG21/Understanding/non-text-contrast.html

Success Criterion 1.4.11 Non-text Contrast (Level AA): The visual presentation of the following have a contrast ratio of at least 3:1 against adjacent color(s):

User Interface Components Visual information required to identify user interface components and states, except for inactive components or where the appearance of the component is determined by the user agent and not modified by the author;

Graphical Objects Parts of graphics required to understand the content, except when a particular presentation of graphics is essential to the information being conveyed

WCAG 1.4.11 - Mat Datepicker.docx

Reproduction

Steps to reproduce:

  1. Open the datepicker component
  2. Tab into the individual dates
  3. Select to pick an active date
  4. Go back into datepicker and use arrow keys to move to between non-selected dates

Expected Behavior

Color contrast should be 3:1 or higher

Actual Behavior

Color contrast for the secondary date when in focus is 1.6:1

Environment

  • Angular: 12.2
  • CDK/Material: 12.2
  • Browser(s): Edge and Chrome
  • Microsoft Edge - Version 103.0.1264.71 (Official build) (64-bit)
  • Chrome - Version 103.0.5060.134 (Official Build) (64-bit)
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows 10 Enterprise

tleck1 avatar Aug 02 '22 16:08 tleck1

Hello,

Thank you for the detailed write-up. Does enabling strong focus indicators fix this problem?

-Zach

P.S. it's generally difficult for us on the Angular team to open .docx and .zip files. If you provide an image or Google doc, we will be happy to read what you wrote.

zarend avatar Sep 16 '22 17:09 zarend

Hi Zach, Thanks for following up. I added two images that show the current situation.... (to replace the .docx file with screenshots).

One of our developers is looking into where we apply the strong focus indicator setting.

For clarification, is the strong focus indicators "theme" setting intended to replace or override the default theme colors? I'm not sure I understand how this setting will replace the existing hex value with something that is WCAG compliant. Are we supposed to declare a color, or a new hex value?

tleck1 avatar Sep 16 '22 20:09 tleck1

Hello @tleck1 ,

I agree with the original bug report that the blue circle for focus state would be better if it had more contrast.

I would suggest enabling strong focus indicators as a work-around. It doesn't fix the NTC issue, but it will help make the focus state more clear. I would recommend the focus indicators regardless of this bug. I'm leaving this bug open, and hopefully a work-around is helpful.

For instructions, see strong focus indicators documentation. For support requests, the best place to reach out is on stackoverflow or even starting a github discussion. We hope the documentation meets your needs, but feel free to file a documentation bug if it does not.

Thanks, Zach

zarend avatar Sep 22 '22 15:09 zarend

Also, we appreciate that the original bug report lists a WCAG rule. That helps make the bug report easier to take action on, and we generally require WCAG rules for a11y bugs 👍

zarend avatar Sep 22 '22 15:09 zarend