angular / angular/components

bug(all): "color" input is not typechecked

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

説明

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

The `color` input of multiple components is not typechecked. It accepts arbitrary strings or even non-string values.

The previous bug report was closed without an action: https://github.com/angular/components/issues/24089

### Reproduction

https://stackblitz.com/edit/urch5g?file=src%2Fexample%2Fbutton-overview-example.html

Note that strict template checks are enabled. If you try to pass an incorrect value (e.g. a number) to the `indeterminate` input of the `mat-checkbox`, the compilation will fail, as expected.

### Expected Behavior

Compilation fails, error message says the value for the `color` input is of incorrect type

### Actual Behavior

The stackblitz example compiles and runs well, despite bogus color values passed to `mat-button` and `mat-checkbox`.

### Environment

The stackblitz above is latest angular - 16 (forked off an example in the Material docs). But it's observed in Angular 15 (various minor versions), and earlier.

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

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

調査の方向性

まず、strict template checks を有効にした状態でリンク先の StackBlitz を再現し、mat-button と mat-checkbox の color inputs に注目します。影響を受けるコンポーネント全体でそれらの inputs がどのように宣言されているかを確認します。数値などの無効な値が incorrect-type error でコンパイルに失敗すれば、作業は完了です。

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

評価

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

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

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