Skip to content
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

bug(material/datepicker): Chrome; A <label> isn't associated with a form field #29749

Closed
1 task
cancakar35 opened this issue Sep 17, 2024 · 1 comment · Fixed by #29755
Closed
1 task

bug(material/datepicker): Chrome; A <label> isn't associated with a form field #29749

cancakar35 opened this issue Sep 17, 2024 · 1 comment · Fixed by #29755
Assignees
Labels
area: material/datepicker P4 A relatively minor issue that is not relevant to core functions

Comments

@cancakar35
Copy link

cancakar35 commented Sep 17, 2024

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

I am using basic datepicker to select a single date. However, chrome devtools shows "A isn't associated with a form field." issue every time datepicker opened. The issiues caused by labels with the mat-calendar-body-hidden-label class.

Reproduction

StackBlitz link: https://stackblitz.com/edit/yyx8cv?file=package.json
Steps to reproduce:

  1. Open the datepicker

Expected Behavior

Not getting a warning.

Actual Behavior

Hundreds of "A isn't associated with a form field."

Environment

  • Angular: 18.2.4
  • CDK/Material: 18.2.4
  • Browser(s): Chrome 128
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows 10
@cancakar35 cancakar35 added the needs triage This issue needs to be triaged by the team label Sep 17, 2024
@crisbeto crisbeto self-assigned this Sep 18, 2024
@crisbeto crisbeto added P4 A relatively minor issue that is not relevant to core functions area: material/datepicker and removed needs triage This issue needs to be triaged by the team labels Sep 18, 2024
crisbeto added a commit to crisbeto/material2 that referenced this issue Sep 18, 2024
Fixes that the datepicker had some `<label>` elements that weren't pointing to anything via the `for` attribute which was being flagged by Chrome.

Fixes angular#29749.
crisbeto added a commit that referenced this issue Sep 18, 2024
…9755)

Fixes that the datepicker had some `<label>` elements that weren't pointing to anything via the `for` attribute which was being flagged by Chrome.

Fixes #29749.

(cherry picked from commit 602bef1)
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Oct 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: material/datepicker P4 A relatively minor issue that is not relevant to core functions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants