Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

bug(MatFormFieldControl, MatInput): enable empty value for element attributes

オープン
#33,353 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

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

調査の方向性

StackBlitz の再現から始め、MatInput の TypeScript 宣言と、issue で名前が挙げられている MatFormFieldControl の実装を調べます。空の placeholder、maxlength、required、および関連する属性の動作を確認し、その後、null と undefined が一貫して受け入れられるようにカバレッジを追加または更新します。

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

説明

area: many gemini-triaged P4
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

21

Description

Recent TypeScript 6 flashes out discrepancies in attributes declaration for html/material controls.

For MatInput, as for other controls, TypeScript doesn't allow empty (null or undefined) values.

The required, placeholder, etc. forces strict datatype while others such as autocomplete are optional.

Previous Angluar version 21 handled these cases correct, for example, placeholder in MatFormField.

In my view, all MatFormFieldControl attributes should be optional, to reflect HTML tag design by definition.

It's common to forward optional attributes between components that holds undefined value; forcing an issue when refering to HTML tag such as input with Angular decoration.

Reproduction

StackBlitz link: https://stackblitz.com/edit/components-issue-starter-ffzyyuuu?file=src%2Fmain.ts
Steps to reproduce:
See errors for empty placehoder and missing maxlength.

Expected Behavior

Attributes such as placeholder should accept null and undefined.

This should be common among all MatFormFieldControl implementations.

Actual Behavior

Common attributes doesn't allow empty values.

Environment

Angular CLI : 22.0.0
Angular : 22.0.0
Node.js : 24.16.0
Package Manager : npm 11.16.0
Operating System : win32 x64

主要言語
TypeScript
スター
25k
フォーク
6.8k
平均マージ
1日 1時間
マージ済み PR(30日)
84

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

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

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

angular/components のほかの issue

angular/components の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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