Skip to content

Angular Material Form Unexpected Behavior After Control Flow Migration #52277

Closed

Description

@swami-sanapathi

Which @angular/* package(s) are the source of the bug?

core

Is this a regression?

No

Description

After running the new control flow migration ng generate @angular/core:control-flow , we encountered unexpected behavior with an Angular Material form component.

Please provide a link to a minimal reproduction of the bug

https://github.com/swami-sanapathi/test-control-flow-migration

Please provide the exception or error you saw

No response

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 17.0.0-next.9
Node: 18.16.0
Package Manager: npm 9.5.1
OS: win32 x64

Angular: 17.0.0-rc.0
... animations, cdk, common, compiler, compiler-cli, core, forms
... material, platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1700.0-next.9
@angular-devkit/build-angular   17.0.0-next.9
@angular-devkit/core            17.0.0-next.9
@angular-devkit/schematics      17.0.0-next.9
@angular/cli                    17.0.0-next.9
@schematics/angular             17.0.0-next.9
rxjs                            7.8.1
typescript                      5.2.2
zone.js                         0.14.0

Anything else?

No response

Activity

  1. swami-sanapathi commented on Oct 19, 2023

    @swami-sanapathi
    ContributorAuthor

    Before Migration:
    image
    image

    After Migration:
    image
    image

  2. swami-sanapathi commented on Oct 19, 2023

    @swami-sanapathi
    ContributorAuthor

    Have attached minimal angular project also, just run the migration.

  3. crisbeto commented on Oct 19, 2023

    @crisbeto
    Member

    Capturing what we talked about with @pkozlowski-opensource over DM: the root cause is that mat-form-field has an <ng-content select="mat-error"/> while at the same time requiring ngIf/@if on mat-error in order to trigger the animation. With the new control flow there's currently no way to project mat-error into the correct slot.

  4. added
    area: core
    core: control flow
    on Oct 19, 2023
  5. modified the milestone: needsTriage on Oct 19, 2023
  6. added a commit that references this issue on Oct 31, 2023
    1f5039b
  7. angular-automatic-lock-bot commented on Dec 1, 2023

    @angular-automatic-lock-bot

    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.

  8. locked and limited conversation to collaborators on Dec 1, 2023
  9. added a commit that references this issue on Jan 23, 2024
    639b436
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area: corecore: control flow

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions