Skip to content

bug(Mat-input): placeholder (label) text contrast too low when error for a11y #25099

Open
@frangarcj

Description

@frangarcj

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

No response

Description

Placeholder text for (the label) is set at #f44336 on an invalid state. This results in text with a contrast ratio of 3.7:1 when the background color is white.

Reproduction

https://stackblitz.com/edit/angular-2anknf?file=src/app/./input-error-state-matcher-example.html

Steps to reproduce:

  1. Focus on email
  2. Get out of email

Expected Behavior

The placeholder text for error doesn't have the minimum contrast ratio set forth by WCAG to achieve a Level AA accessibility rating of 4.5:1. Therefore the colour must be changed in order to get a proper result.

Actual Behavior

This results in text with a contrast ratio of 3.7:1 when the background color is white.

Environment

  • Angular: 13.3.6
  • CDK/Material: 13.3.6
  • Browser(s): All
  • Operating System (e.g. Windows, macOS, Ubuntu): All

Activity

added
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
AccessibilityThis issue is related to accessibility (a11y)
and removed
needs triageThis issue needs to be triaged by the team
on Jun 22, 2022
jelbourn

jelbourn commented on Jun 28, 2022

@jelbourn
Member

@zarend does this issue exist in the MDC-based version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    AccessibilityThis issue is related to accessibility (a11y)P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: material/input

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @frangarcj@jelbourn@zarend

        Issue actions

          bug(Mat-input): placeholder (label) text contrast too low when error for a11y · Issue #25099 · angular/components