Skip to content

Signal Forms - Form reset causes effect to rerun #65322

@tylerlittle

Description

@tylerlittle

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

forms

Is this a regression?

No

Description

I have been experimenting with signal forms and have run into an issue. When I call form.reset() from within an effect, each time a form control changes in value, the effect is rerun causing the form to never be dirty. This can be avoided by wrapping form.reset() within untracked but I'd prefer not to do so as I would have to do this many times in a real application. Is this possibly an issue with the reset function?

Please provide a link to a minimal reproduction of the bug

https://stackblitz.com/edit/stackblitz-starters-k5kqmegw?file=src%2Fmain.ts

Please provide the exception or error you saw

No exception or errors occurring.

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

Angular CLI       : 21.0.0-rc.5
Angular           : 21.0.0-rc.3
Node.js           : 20.19.3
Package Manager   : npm 10.8.2
Operating System  : win32 x64

┌───────────────────────────┬───────────────────┬───────────────────┐
│ Package                   │ Installed Version │ Requested Version │
├───────────────────────────┼───────────────────┼───────────────────┤
│ @angular/animations       │ 21.0.0-rc.3       │ 21.0.0-rc.3       │
│ @angular/build            │ 21.0.0-rc.5       │ ^21.0.0-rc.5      │
│ @angular/cli              │ 21.0.0-rc.5       │ 21.0.0-rc.5       │
│ @angular/common           │ 21.0.0-rc.3       │ 21.0.0-rc.3       │
│ @angular/compiler         │ 21.0.0-rc.3       │ 21.0.0-rc.3       │
│ @angular/compiler-cli     │ 21.0.0-rc.3       │ 21.0.0-rc.3       │
│ @angular/core             │ 21.0.0-rc.3       │ 21.0.0-rc.3       │
│ @angular/forms            │ 21.0.0-rc.3       │ 21.0.0-rc.3       │
│ @angular/platform-browser │ 21.0.0-rc.3       │ 21.0.0-rc.3       │
│ @angular/router           │ 21.0.0-rc.3       │ 21.0.0-rc.3       │
│ rxjs                      │ 7.8.2             │ ^7.8.1            │
│ typescript                │ 5.9.3             │ ^5.8.2            │
│ zone.js                   │ 0.15.0            │ ~0.15.0           │
└───────────────────────────┴───────────────────┴───────────────────┘

Anything else?

No response

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions