angular / angular/components

feat(inputs): Add `[readonly]` property to input components

オープン
#27,955 コメント 9 件 リアクション 16 件 担当者 0 名 GitHub で見る
feature P4
主要言語
TypeScript
スター
25k
フォーク
6.8k
平均マージ
1日 8時間
マージ済み PR(30日)
91

説明

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

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

まず、matInput ディレクティブの既存の [readonly] の動作を、checkbox、chips、datepicker、form field、radio button、select、slider コンポーネントと比較します。disabled と value の相互作用を理解するため、リンク先の FormControlDirective のプロパティと AbstractControl のドキュメントを読みます。完了条件は、一覧にある各コンポーネントが [readonly] をサポートし、form.value からその値を除外しないことです。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
angular, typescript
領域
frontend
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。