feat(inputs): Add `[readonly]` property to input components
- Vorherrschende Sprache
- TypeScript
- Sterne
- 25k
- Forks
- 6.8k
- Ø Merge
- 1 T. 8 Std.
- Gemergte PRs (30 T.)
- 91
Beschreibung
### 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.
Beitragsleitfaden
Rechercherichtung
Beginne damit, das vorhandene Verhalten von [readonly] bei der matInput-Direktive mit den Komponenten checkbox, chips, datepicker, form field, radio button, select und slider zu vergleichen. Lies die verlinkte Dokumentation zur Eigenschaft von FormControlDirective und zu AbstractControl, um die Wechselwirkung zwischen disabled und value zu verstehen. Fertig bedeutet, dass jede aufgeführte Komponente [readonly] unterstützt, ohne ihren Wert aus form.value auszuschließen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- angular, typescript
- Bereich
- frontend
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100