Title: Signal Forms / FormValueControl violates ControlValueAccessor contract by calling writeValue back after onChange, causing infinite loop · Issue #67847 · angular/angular · GitHub
Open Graph Title: Signal Forms / FormValueControl violates ControlValueAccessor contract by calling writeValue back after onChange, causing infinite loop · Issue #67847 · angular/angular
X Title: Signal Forms / FormValueControl violates ControlValueAccessor contract by calling writeValue back after onChange, causing infinite loop · Issue #67847 · angular/angular
Description: Which @angular/* package(s) are the source of the bug? forms Is this a regression? No Description Signal forms break the one-way ControlValueAccessor contract by calling writeValue back on a CVA component after that component called onCh...
Open Graph Description: Which @angular/* package(s) are the source of the bug? forms Is this a regression? No Description Signal forms break the one-way ControlValueAccessor contract by calling writeValue back on a CVA co...
X Description: Which @angular/* package(s) are the source of the bug? forms Is this a regression? No Description Signal forms break the one-way ControlValueAccessor contract by calling writeValue back on a CVA co...
Opengraph URL: https://github.com/angular/angular/issues/67847
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Signal Forms / FormValueControl violates ControlValueAccessor contract by calling writeValue back after onChange, causing infinite loop","articleBody":"### Which @angular/* package(s) are the source of the bug?\n\nforms\n\n### Is this a regression?\n\nNo\n\n### Description\n\nSignal forms break the one-way `ControlValueAccessor` contract by calling `writeValue` back on a CVA component after that component called `onChange`, directly contradicting Angular's own documentation.\n\n### The documented contract\n\nAngular's official documentation at angular.dev states clearly:\n\n> **`writeValue(value: any): void`**\n> Writes a new value to the element.\n> This method is called by the forms API to write to the view when **programmatic changes from model to view** are requested.\n\nThis defines a strict one-way contract:\n\n- `writeValue(value)` — called by the **form** for programmatic, external, model-to-view changes only\n- `onChange(value)` — called by the **component** when the user changes the value (view-to-model)\n\nThese two directions must never form a loop. Angular's classic `FormControl` correctly respects this — calling `onChange` updates the `FormControl`'s internal value but does **not** trigger `writeValue` back on the CVA. Signal forms do not respect this.\n\n### What Signal forms does wrong\n\nWhen a CVA component bound via `[formField]` calls `onChange(value)`, the Signal form updates its internal signal. Because Signal form has no concept of **value origin** — it does not distinguish between a programmatic external `set()` and a value that just arrived from the CVA via `onChange` — it reactively pushes the value back to `writeValue` on the same CVA that just sent it:\n\n```\nUser types in CVA component\n → onChange(\"hello\") called\n → Signal form signal updates\n → writeValue(\"hello\") called back on CVA ← violates documented contract\n```\n\nThe same issue applies to `FormValueControl`, the Signal form equivalent of CVA. There is no mechanism to indicate **who** submitted the change — whether it originated from inside the component or from an external model update. Without that distinction, any reactive form implementation will produce this loopback.\n\n### Real-world impact\n\nWe implemented a CodeMirror editor as a `ControlValueAccessor`. CodeMirror manages its own internal document state. Our contract is:\n\n- `writeValue` = programmatic value from outside, push into CodeMirror\n- `onChange` = user edited the document, notify the form\n\nWhen Signal form calls `writeValue` back after our `onChange`, we are forced to either:\n\n1. **Compare the incoming `writeValue` value against CodeMirror's current document** to detect the loopback — an O(n) string comparison on every keystroke. For large documents exceeding 1MB this causes severe and measurable performance degradation.\n2. **Use a dirty flag** to suppress the loopback `writeValue` — a workaround that should not be necessary and compensates for a broken contract.\n\nNeither workaround is acceptable. `FormControl` does not require either. The behaviour difference between `FormControl` and Signal form for the same CVA implementation is a clear regression in the Signal form design.\n\n### Expected behaviour\n\nSignal form must not call `writeValue` on a CVA in response to a value that was just received from that same CVA's `onChange`. This is the documented contract and the behaviour `FormControl` has always correctly implemented.\n\n### Please provide a link to a minimal reproduction of the bug\n\n_No response_\n\n### Please provide the exception or error you saw\n\n```true\n\n```\n\n### Please provide the environment you discovered this bug in (run `ng version`)\n\n```true\nAngular CLI: 21.2.3\nNode: 22.21.1\nPackage Manager: npm 10.9.4\nOS: Windows 11 x64\n\nAngular: 21.2.5\n... animations, cli, common, compiler, core, forms, localize, platform-browser, platform-browser-dynamic, router, sdk\n```\n\n### Anything else?\n\n_No response_","author":{"url":"https://github.com/Nness","@type":"Person","name":"Nness"},"datePublished":"2026-03-25T02:52:10Z","url":"https://github.com/angular/angular/issues/67847"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:d8cad500-f5d0-6281-a429-91f67f3d40fe |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 91C2:172F33:31AC0:3ED6C:6B01E74D |
| html-safe-nonce | fa8048165901c36a4ba6a2455d660687eec3c296a182289f44e15f5f3888340d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MUMyOjE3MkYzMzozMUFDMDozRUQ2Qzo2QjAxRTc0RCIsInZpc2l0b3JfaWQiOiI0MTk0NDgzNjY0NTcyMjQ1ODM3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | ffde2504c582debda8dc5ebe688ebeb401e37362126ad2a00a74442074695a8c |
| hovercard-subject-tag | issue:4132004588 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/67847/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9a724b154f7225997a889710f2a6c6035fc25db3561bc1276370385668abac42/angular/angular/issues/67847 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9a724b154f7225997a889710f2a6c6035fc25db3561bc1276370385668abac42/angular/angular/issues/67847 |
| og:image:alt | Which @angular/* package(s) are the source of the bug? forms Is this a regression? No Description Signal forms break the one-way ControlValueAccessor contract by calling writeValue back on a CVA co... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Nness |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular git https://github.com/angular/angular.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 24195339 |
| octolytics-dimension-repository_nwo | angular/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24195339 |
| octolytics-dimension-repository_network_root_nwo | angular/angular |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width