bug(mat-checkbox): with Signal Forms `required()`, MatCheckbox's own validator adds a duplicate `required` error that hides the schema error message
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- angular, typescript
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- TypeScript
- Estrellas
- 25k
- Forks
- 6.8k
- Merge medio
- 1 d 5 h
- PR fusionados (30 d)
- 67
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de angular/components
-
bug(material/sort): hover hint arrow on an unsorted header shows the active sort direction, not the resulting direction after click.Posiblemente ocupada @lekhmanrus la tomó hace 11 días. Abiertoarea: material/sort P3
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
angular/components#33933 ·
Los mantenedores suelen responder en 1 día
-
bug(mat-date-picker): month shown twice in date pickerPosiblemente ocupada @PreethiPantangi la tomó hace 28 días. Abiertoarea: material/datepicker P4
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
angular/components#33763 · 2 comentarios · 3 reacciones ·
Los mantenedores suelen responder en 1 día
-
Bug in table.scss footer cell height: unset instead of footer row height unsetPosiblemente ocupada @minwookshin la tomó hace 15 días. Abiertoarea: material/table P4
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
angular/components#33709 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
docs-bug(Table): Add example with `rowspan`Posiblemente ocupada @BHUVANSH855 la tomó hace 96 días. Abiertoarea: material/table docs P4
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
angular/components#33455 ·
Los mantenedores suelen responder en 1 día
-
bug(date-adapter): Misleading JSDoc for createDate returns typePosiblemente ocupada @BHUVANSH855 la tomó hace 145 días. Abiertoarea: material/core P3
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
angular/components#33059 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de angular/components
Issues similares
-
Admin search throws for permissions added through Admin.generalIndexItems('permissions', ...)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Koenkk/zigbee-herdsman-converters#13540 ·
Los mantenedores suelen responder en 1 día
-
Add: Tequila Music TV RO SDAbiertocheck:passed streams:add
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
iptv-org/iptv#55821 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
area/busola/ux
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
kyma-project/busola#5442 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
vercel-labs/wterm#246 ·
Los mantenedores suelen responder en 1 día