Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

@for does not properly track an array of signal form fields #63882

Copy link
Copy link
@leonsenft

Description

@leonsenft
Issue body actions

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

forms

Is this a regression?

No

Description

When using @for to render an array of fields from a signal form instance, @for does not properly track changes to the order of array values.

The reproduction demonstrates the behavior of @for when used to render an array whose values are rearranged. After the initial render the first DOM element rendered for each array item is colored red with a dashed border.

When the array elements are reordered, we'd expect their corresponding rendered <input> elements to be reordered in the DOM.

  • This works as expected for an array. No bindings are updated, and the DOM elements are reordered.
  • This does not work as expected for an array of fields. Bindings are updated, and the DOM elements are left untouched. Superficially, this appears to work, as the value in the inputs is swapped. However, as demonstrated by the red dashed border, one can observe that the input itself is not swapped as expected.

Please provide a link to a minimal reproduction of the bug

https://stackblitz.com/edit/for-signal-forms

msmallest and sebayomhaboost

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done
    Show more project fields

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.