Visitar URL original
fix(forms): prioritize explicit custom control constraints by splincode 路 Pull Request #70970 路 angular/angular 路 GitHub
The Wayback Machine - https://web.archive.org/web/20260927120931/https://github.com/angular/angular/pull/70970
Skip to content

fix(forms): prioritize explicit custom control constraints - #70970

Open
splincode wants to merge 1 commit into
angular:mainfrom
splincode:fix/signal-forms-explicit-constraints
Open

splincode wants to merge 1 commit into
angular:mainfrom
splincode:fix/signal-forms-explicit-constraints

Conversation

@splincode

Copy link
Copy Markdown
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.dev application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Signal Forms treat min, max, minLength, and maxLength inputs on custom controls as form constraints. This rejects explicitly bound inputs whose types differ from the form value and can overwrite component settings with values from the form schema.

Issue Number: #70600

What is the new behavior?

When one of these inputs is explicitly bound on a custom control, Angular checks it against the component input type and leaves its runtime value under the component's ownership. Constraints without explicit bindings continue to sync from the schema, and schema validation continues to run.

Native controls retain their existing diagnostics. An [attr.min] binding does not count as an explicit component input. Optional type parameters let controls implementing FormUiControl or FormValueControl describe their own constraint input types.

Does this PR introduce a breaking change?

  • Yes
  • No

Allow custom controls to own explicitly bound min, max, minLength, and
maxLength inputs, and type-check them against component inputs. Avoid
overwriting their values from the form schema while keeping unbound
constraints synchronized.

Verify that a schema min() rule still validates the field independently
of an explicitly bound component min input.

Fixes angular#70600
@pullapprove
pullapprove Bot requested a review from crisbeto September 26, 2026 19:53
@ngbot ngbot Bot added this to the Backlog milestone Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant