angular / components

Component infrastructure and Material Design components for Angular
https://material.angular.io
MIT License
24.31k stars 6.72k forks source link

bug(FormField): Tabbing to then out of form field with "required" validator shows validation error. #27625

Open lee-cooper opened 1 year ago

lee-cooper commented 1 year ago

Is this a regression?

The previous version in which this bug was not present was

No response

Description

Premature error validation occurs when tabbing from the form field text entry section to the datepicker button. From an A11Y and usability perspective, this should not occur until the user has left the containing form field and button since the datepicker button is a valid way of filling out the form field.

Reproduction

StackBlitz link: https://components-issue-zzukvj.stackblitz.io Steps to reproduce:

  1. Add Datepicker to app from angular material code example
  2. Add required validator to form control
  3. Tab from the form field section to the datepicker button
  4. Error shows, despite not having left the control

Expected Behavior

Required validation does not occur when tabbing from the text entry section of the datepicker to the calendar pop-out button.

It should only occur when tabbing out of the containing form field and button.

Actual Behavior

Required error validation occurs when tabbing from the text entry section of the datepicker to the open calendar button

Environment

amysorto commented 1 year ago

I am unable to open the stackblitz it seems, can you check the link on your end?

lee-cooper commented 1 year ago

Hey @amysorto, it opens for me! I double checked the privacy settings and the url and it seems to be okay.

Screenshot 2023-08-12 at 10 56 52 AM Screenshot 2023-08-12 at 10 58 32 AM
zarend commented 1 year ago

I can reproduce the reported behavior on the stackblitz link.

zarend commented 6 months ago

Hello folks, Thank you for reporting this issue. Unfortunately we are not able to take action if we cannot reproduce it. This might have already been fixed. If the issue persists, please provide reproduction steps or file a new issue report. -Zach

lee-cooper commented 6 months ago

Hello folks, Thank you for reporting this issue. Unfortunately we are not able to take action if we cannot reproduce it. This might have already been fixed. If the issue persists, please provide reproduction steps or file a new issue report. -Zach

Hi, I've replicated the issue using Angular 17. Can this be re-opened @zarend ?

https://stackblitz.com/edit/stackblitz-starters-b6hqgj?file=src%2Findex.html

2024-02-27_15-51-36 (1)

lee-cooper commented 6 months ago

Hello folks, Thank you for reporting this issue. Unfortunately we are not able to take action if we cannot reproduce it. This might have already been fixed. If the issue persists, please provide reproduction steps or file a new issue report. -Zach

Also, I'm confused because even you said you could reproduce this back in August, and are now saying you can't.

zarend commented 6 months ago

Hello folks, Let's reopen this and take a look at https://stackblitz.com/edit/stackblitz-starters-b6hqgj?file=src%2Findex.html. -Zach

zarend commented 6 months ago

Hello folks, I can reproduce without Datepicker, only need Formfield . I don't think Datepicker is related and this may happen with any form field with "required" validator.

https://stackblitz.com/edit/stackblitz-starters-dxpwt7?file=src%2Fmain.ts

-Zach

zarend commented 6 months ago

Hello, I updated the title to clarify that the root cause is in form field, which affects multiple components. That way this issue can get more attention. -Zach

lee-cooper commented 6 months ago

Thanks for re-opening this Zach, I realize could've done a better job describing the issue to get this more traction.

Looking forward to what comes next!