Skip to content

fix(core): ensure custom controls resolve host directives#67329

Open
alxhub wants to merge 2 commits intoangular:mainfrom
alxhub:sf-host-directive-test
Open

fix(core): ensure custom controls resolve host directives#67329
alxhub wants to merge 2 commits intoangular:mainfrom
alxhub:sf-host-directive-test

Conversation

@alxhub
Copy link
Member

@alxhub alxhub commented Feb 26, 2026

Custom controls can be modeled using a set of host directives to alias and expose value and valueChange (or checked/checkedChange) bindings, as well as native attributes like disabled.

This commit updates initializeCustomControlStatus to correctly identify host components using mapped inputs/outputs, even when those inputs are exposed via transitive host directives. It also updates customControlHasInput so that the custom control presence check correctly evaluates the exposed inputs across all applied host directives, caching the result to optimize performance on hot code paths.

@angular-robot angular-robot bot added detected: feature PR contains a feature commit area: compiler Issues related to `ngc`, Angular's template compiler area: core Issues related to the framework runtime area: forms labels Feb 26, 2026
@ngbot ngbot bot added this to the Backlog milestone Feb 26, 2026
@alxhub alxhub force-pushed the sf-host-directive-test branch from cb8f8e2 to 511babe Compare February 26, 2026 17:37
@alxhub alxhub changed the title fix(core): ensure custom controls resolve transitive host directives fix(core): ensure custom controls resolve host directives Feb 26, 2026
@alxhub alxhub force-pushed the sf-host-directive-test branch from 511babe to b3f7cdd Compare February 26, 2026 19:21
Custom controls can be modeled using a set of host directives to alias
and expose value and valueChange (or checked/checkedChange) bindings,
as well as native attributes like disabled.

This commit updates initializeCustomControlStatus to correctly identify
host components using mapped inputs/outputs, even when those inputs are
exposed via transitive host directives. It also updates
customControlHasInput so that the custom control presence check correctly
evaluates the exposed inputs across all applied host directives, caching
the result to optimize performance on hot code paths.
…inputs

Issue angular#65889 reported that FormUiControl does not support transformed inputs. This test asserts that FormValueControl components can legally use type-altering transforms for inputs like the disabled property.

Closes angular#65889
@alxhub alxhub force-pushed the sf-host-directive-test branch from b3f7cdd to d10ce0d Compare February 26, 2026 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: compiler Issues related to `ngc`, Angular's template compiler area: core Issues related to the framework runtime area: forms detected: feature PR contains a feature commit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant