feat(inputs): Add `[readonly]` property to input components
- Langage dominant
- TypeScript
- Étoiles
- 25k
- Forks
- 6.8k
- Merge moyen
- 1 j 8 h
- PR mergées (30 j)
- 91
Description
### Feature Description
Right now input components (checkbox, chips, datepicker, form field, radio button, select, slider) have `[disabled]` property. Only `matInput` directive has `[readonly]`.
`[disabled]` property conflicts with the `[formControl]` directive, which has a [property with the same name](https://github.com/angular/angular/blob/main/packages/forms/src/directives/reactive_directives/form_control_directive.ts#L72).
So if you use `[formControl]` with the components listed above, it is not possible to use their `[disabled]` property.
### Use Case
`[disabled]` controls [will not be included](https://github.com/angular/angular/blob/main/packages/forms/src/model/abstract_model.ts#L409) in `form.value` - sometimes you need to render an input element as read-only but still send its value to the server.
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez par comparer le comportement existant de [readonly] sur la directive matInput avec les composants checkbox, chips, datepicker, form field, radio button, select et slider. Lisez la documentation liée sur la propriété de FormControlDirective et sur AbstractControl afin de comprendre l’interaction entre disabled et value. Le travail est terminé lorsque chaque composant listé prend en charge [readonly] sans exclure sa valeur de form.value.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- angular, typescript
- Domaine
- frontend
- Type d'issue
- Fonctionnalité
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100