Skip to content

fix(forms): only propagate schema defined properties from field to control#64446

Closed
leonsenft wants to merge 4 commits intoangular:mainfrom
leonsenft:field-state-props
Closed

fix(forms): only propagate schema defined properties from field to control#64446
leonsenft wants to merge 4 commits intoangular:mainfrom
leonsenft:field-state-props

Conversation

@leonsenft
Copy link
Copy Markdown
Contributor

@leonsenft leonsenft commented Oct 15, 2025

Prior to this change, FieldState defined a signal for each built-in property. This unfortunately meant that the Field directive had no way of knowing which property had actually been defined in the schema, and would thus attempt to propagate them all to the bound form control. This meant that the default values of these signals would override the default or template defined values of these control properties.

Now these properties are undefined by default, and only initialized if defined in the schema. Thus the Field directive will not attempt to bind any properties that aren't explicitly managed by the schema.

@leonsenft leonsenft requested a review from kirjs October 15, 2025 18:21
@leonsenft leonsenft added area: forms target: major This PR is targeted for the next major release forms: signals labels Oct 15, 2025
@ngbot ngbot bot modified the milestone: Backlog Oct 15, 2025
@leonsenft leonsenft force-pushed the field-state-props branch 2 times, most recently from a4fd662 to 7b6fab6 Compare October 17, 2025 18:05
Note that unlike the other built-in properties, `pattern` is not
propagated to native controls so the lack of symmetry with other
property tests is intentional.
`FormUiControl` is the base type used for shared properties of
`FormValueControl` and `FormCheckboxControl`.
…ntrol

Prior to this change, `FieldState` defined a signal for each built-in
property. This unfortunately meant that the `Field` directive had no way
of knowing which property had actually been defined in the schema, and
would thus attempt to propagate them all to the bound form control. This
meant that the default values of these signals would override the
default or template defined values of these control properties.

Now these properties are `undefined` by default, and only initialized if
defined in the schema. Thus the `Field` directive will not attempt to
bind any properties that aren't explicitly managed by the schema.
Copy link
Copy Markdown
Contributor

@kirjs kirjs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewed-for: public-api

@leonsenft leonsenft added the action: merge The PR is ready for merge by the caretaker label Oct 21, 2025
thePunderWoman pushed a commit that referenced this pull request Oct 21, 2025
…64446)

`FormUiControl` is the base type used for shared properties of
`FormValueControl` and `FormCheckboxControl`.

PR Close #64446
thePunderWoman pushed a commit that referenced this pull request Oct 21, 2025
…ntrol (#64446)

Prior to this change, `FieldState` defined a signal for each built-in
property. This unfortunately meant that the `Field` directive had no way
of knowing which property had actually been defined in the schema, and
would thus attempt to propagate them all to the bound form control. This
meant that the default values of these signals would override the
default or template defined values of these control properties.

Now these properties are `undefined` by default, and only initialized if
defined in the schema. Thus the `Field` directive will not attempt to
bind any properties that aren't explicitly managed by the schema.

PR Close #64446
@thePunderWoman
Copy link
Copy Markdown
Contributor

This PR was merged into the repository. The changes were merged into the following branches:

@leonsenft leonsenft deleted the field-state-props branch November 6, 2025 17:42
@angular-automatic-lock-bot
Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Dec 7, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: forms forms: signals target: major This PR is targeted for the next major release

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants