angular / angular/components

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

Offen
#27,625 10 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
area: material/datepicker area: material/form-field P3
Vorherrschende Sprache
TypeScript
Sterne
25k
Forks
6.8k
Ø Merge
1 T. 8 Std.
Gemergte PRs (30 T.)
91

Beschreibung

### 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

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

- Angular: 15.2.4
- CDK/Material: 15.2.5
- Browser(s): Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): macOS, Windows

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne damit, das Verhalten im verlinkten StackBlitz mit dem Angular Material datepicker und einem erforderlichen form control zu reproduzieren, und untersuche anschließend die Implementierung von datepicker und form-field. Als abgeschlossen gilt, dass beim Tabben von der Texteingabe zur Kalenderschaltfläche der erforderliche Fehler nicht angezeigt wird, während das Verlassen beider weiterhin die Validierung auslöst.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
angular, typescript
Bereich
accessibility, frontend
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.