bug(mat-checkbox): with Signal Forms `required()`, MatCheckbox's own validator adds a duplicate `required` error that hides the schema error message
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 48/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- angular, typescript
Rechercherichtung
Start by tracing how Signal Forms errors are combined with the MatCheckbox validator; the issue names MatCheckbox.validate() and CompatValidationError but does not identify source files or tests. Reproduce with the linked StackBlitz and inspect the error output. Done means the field exposes only the schema’s required error, including its custom message.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
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
When a mat-checkbox is bound to a Signal Forms field with [formField] and the schema uses required(), the field ends up with two errors of kind required:
- the schema error from
required(path, { message })- has the custommessage; - a
CompatValidationError(kindrequired, nomessage) produced byMatCheckbox.validate().
This happens with many components which have 'required' input and validate method from Validators interface.
Reproduction
StackBlitz link: https://stackblitz.com/edit/1sinlau9-qd7bhr37?file=src%2Fexample%2Fcheckbox-signal-forms-example.ts
Steps to reproduce:
- Open the console
- Click the 'Show errors' button. The first
getError('required)log showskind: requiredandmessage: undefined. The seconderrors()log shows 2 errors.
As the result nothing is rendered
Expected Behavior
- The field has a single
requirederror, the one from the schema.
Actual Behavior
errors()contains tworequirederrors: first aCompatValidationErrorfromMatCheckbox.validate()(messageisundefined), then the schema error.getError('required')returns the first one, sogetError('required')?.messageisundefinedand nothing is rendered.
Environment
- Angular: 22.0.6
- CDK/Material: 22.0.4
- Browser(s): Google Chrome Version 154.0.8037.98
- Operating System: MacOs 27.0
- Vorherrschende Sprache
- TypeScript
- Sterne
- 25k
- Forks
- 6.8k
- Ø Merge
- 1 T. 4 Std.
- Gemergte PRs (30 T.)
- 69
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus angular/components
-
bug(material/sort): hover hint arrow on an unsorted header shows the active sort direction, not the resulting direction after click.Evtl. vergeben @lekhmanrus hat das vor 10 Tagen übernommen. Offenarea: material/sort P3
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
angular/components#33933 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug(mat-date-picker): month shown twice in date pickerEvtl. vergeben @PreethiPantangi hat das vor 27 Tagen übernommen. Offenarea: material/datepicker P4
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
angular/components#33763 · 2 Kommentare · 3 Reaktionen ·
Maintainer antworten meist innerhalb von 1 Tag
-
Bug in table.scss footer cell height: unset instead of footer row height unsetEvtl. vergeben @minwookshin hat das vor 14 Tagen übernommen. Offenarea: material/table P4
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
angular/components#33709 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
docs-bug(Table): Add example with `rowspan`Evtl. vergeben @BHUVANSH855 hat das vor 95 Tagen übernommen. Offenarea: material/table docs P4
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
angular/components#33455 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug(date-adapter): Misleading JSDoc for createDate returns typeEvtl. vergeben @BHUVANSH855 hat das vor 144 Tagen übernommen. Offenarea: material/core P3
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 78/100
angular/components#33059 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in angular/components
Ähnliche Issues
-
The inspector never shows the instances field, so scaling out is unreachableEvtl. vergeben @Mrkewl hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
xevrion/breakscale#96 ·
Maintainer antworten meist innerhalb von 4 Tagen
-
Object parameters lose their structure when resources is enabledEvtl. vergeben @asts-top hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
rossant/awesome-math#199 ·
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
jaegertracing/jaeger-ui#4618 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
mifi/lossless-cut#3125 ·
Maintainer antworten meist innerhalb von 1 Tag