angular / angular/components

MatDatepicker - WCAG 1.4.11 Issue

Open
#25,378 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Accessibility area: material/datepicker P3
Dominant language
TypeScript
Stars
25k
Forks
6.8k
Avg merge
1d 8h
Merged PRs (30d)
91

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the datepicker issue using the listed keyboard steps and review the attached WCAG 1.4.11 document and screenshots. Identify the styling for the secondary date focus state, then verify that its contrast against adjacent colors reaches at least 3:1 and that the datepicker behavior remains correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, typescript
Domain
accessibility, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.