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

bug(mat-checkbox): with Signal Forms `required()`, MatCheckbox's own validator adds a duplicate `required` error that hides the schema error message

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

メンテナーはふだん 1 日以内に返信

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

評価

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

調査の方向性

Start by tracing how Signal Forms errors are combined with the MatCheckbox validator; the issue names MatCheckbox.validate() and CompatValidationError but does not identify source files or tests. Reproduce with the linked StackBlitz and inspect the error output. Done means the field exposes only the schema’s required error, including its custom message.

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

説明

area: material/checkbox P3
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

When a mat-checkbox is bound to a Signal Forms field with [formField] and the schema uses required(), the field ends up with two errors of kind required:

  1. the schema error from required(path, { message }) - has the custom message;
  2. a CompatValidationError (kind required, no message) produced by MatCheckbox.validate().

This happens with many components which have 'required' input and validate method from Validators interface.

Reproduction

StackBlitz link: https://stackblitz.com/edit/1sinlau9-qd7bhr37?file=src%2Fexample%2Fcheckbox-signal-forms-example.ts
Steps to reproduce:

  1. Open the console
  2. Click the 'Show errors' button. The first getError('required) log shows kind: required and message: undefined. The second errors() log shows 2 errors.

As the result nothing is rendered

Expected Behavior
  • The field has a single required error, the one from the schema.
Actual Behavior
  • errors() contains two required errors: first a CompatValidationError from MatCheckbox.validate() (message is undefined), then the schema error.
  • getError('required') returns the first one, so getError('required')?.message is undefined and nothing is rendered.
Environment
  • Angular: 22.0.6
  • CDK/Material: 22.0.4
  • Browser(s): Google Chrome Version 154.0.8037.98
  • Operating System: MacOs 27.0
主要言語
TypeScript
スター
25k
フォーク
6.8k
平均マージ
1日 5時間
マージ済み PR(30日)
67

環境構築

はじめの一歩

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

angular/components のほかの issue

angular/components の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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