René's URL Explorer Experiment


Title: Reactive forms: transformedValue control shows an empty value after reset() followed by setting the previous value · Issue #72068 · angular/angular · GitHub

Open Graph Title: Reactive forms: transformedValue control shows an empty value after reset() followed by setting the previous value · Issue #72068 · angular/angular

X Title: Reactive forms: transformedValue control shows an empty value after reset() followed by setting the previous value · Issue #72068 · angular/angular

Description: Which @angular/* package(s) are the source of the bug? forms Is this a regression? No Description A FormValueControl that uses transformedValue shows an empty input after a reactive form is reset and then set back to the value it had bef...

Open Graph Description: Which @angular/* package(s) are the source of the bug? forms Is this a regression? No Description A FormValueControl that uses transformedValue shows an empty input after a reactive form is reset a...

X Description: Which @angular/* package(s) are the source of the bug? forms Is this a regression? No Description A FormValueControl that uses transformedValue shows an empty input after a reactive form is reset a...

Opengraph URL: https://github.com/angular/angular/issues/72068

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Reactive forms: transformedValue control shows an empty value after reset() followed by setting the previous value","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\nA `FormValueControl` that uses `transformedValue` shows an empty input after a reactive form is reset and then set back to the value it had before the reset, in the same tick.\n\n```ts\nimport { ChangeDetectionStrategy, Component, model } from '@angular/core';\nimport { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';\nimport { FormValueControl, transformedValue } from '@angular/forms/signals';\nimport { bootstrapApplication } from '@angular/platform-browser';\n\n@Component({\n  selector: 'app-text-input',\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  template: `\u003cinput [value]=\"rawValue()\" (input)=\"rawValue.set($any($event.target).value)\" />`,\n})\nexport class TextInput implements FormValueControl\u003cstring | null> {\n  readonly value = model\u003cstring | null>(null);\n  protected readonly rawValue = transformedValue(this.value, {\n    parse: (raw: string) => ({ value: raw || null }),\n    format: (value: string | null) => value ?? '',\n  });\n}\n\n@Component({\n  selector: 'app-root',\n  imports: [ReactiveFormsModule, TextInput],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n  template: `\n    \u003cform [formGroup]=\"form\">\n      \u003capp-text-input formControlName=\"name\" />\n      \u003cinput formControlName=\"name\" />\n    \u003c/form>\n    \u003cbutton (click)=\"reload()\">reset + patchValue (same value)\u003c/button>\n    \u003cp>Control value: \"{{ form.value.name }}\"\u003c/p>\n  `,\n})\nexport class App {\n  protected readonly form = new FormGroup({ name: new FormControl\u003cstring | null>('Ada') });\n\n  protected reload(): void {\n    this.form.reset();\n    this.form.patchValue({ name: 'Ada' });\n  }\n}\n\nbootstrapApplication(App);\n```\n\nClick the button. The native input and the control value still show \"Ada\", but the custom input is empty. If change detection runs between `reset()` and `patchValue()`, everything stays in sync.\n\n#### Cause\n\nThe reset propagation added in 849dba6 updates the raw value without updating the model or the cache of the last value written to the control:\n\n1. On `FormResetEvent`, `NgControl` calls the reset callback with `control.value`, which is `null` here ([ng_control.ts](https://github.com/angular/angular/blob/1e6afa4cb84c/packages/forms/src/directives/ng_control.ts#L89-L103)).\n2. `transformedValue` writes `format(null)` into its raw-value `linkedSignal` with `originalSet`, bypassing the model on purpose ([transformed_value.ts](https://github.com/angular/angular/blob/1e6afa4cb84c/packages/forms/signals/src/api/transformed_value.ts#L140-L144)). The control's `value` model is still `'Ada'`, because `NgControl` only writes it during change detection.\n3. `patchValue({name: 'Ada'})` sets the `FormControl` back to `'Ada'`.\n4. During change detection, `ngControlUpdate` skips the write because `customControlBindings.value` is still `'Ada'` ([ng_control.ts](https://github.com/angular/angular/blob/1e6afa4cb84c/packages/forms/src/directives/ng_control.ts#L381-L387)). The model never changes, so the `linkedSignal` never recomputes and keeps the empty raw value.\n\nThe same commit handles this for CVA controls under `[formField]`: the `reset` binding in `control_cva.ts` writes the value and updates `bindings['controlValue']`, so later updates are compared against what the control really holds. The FVC path under `NgControl` has no equivalent.\n\n#### Proposed fix\n\nMirror the CVA reset in `NgControl`. On `FormResetEvent`, before calling the reset callback, `NgControl` should write the reset value to the custom control's `value` model and update `customControlBindings.value` to match. Any pending custom value (for `updateOn: 'blur'` or `'submit'`) should be discarded at the same time, as `ngControlUpdate` already does when it overwrites the control.\n\nThe model has to be written during the reset, not on the next change detection. If the write is deferred, `transformedValue` still formats the reset value while the model holds the old one, and when the previous value is written back the model doesn't change, so the raw value is never recomputed.\n\n### Please provide a link to a minimal reproduction of the bug\n\nThe example in the description is a complete `src/main.ts`: paste it into a new Angular 22 project (for example `ng new --minimal`) and run `ng serve`.\n\n### Please provide the exception or error you saw\n\nNo errors\n\n### Please provide the environment you discovered this bug in (run `ng version`)\n\n```true\nAngular CLI       : 22.2.7\nAngular           : 22.2.6\nNode.js           : 22.23.3\nPackage Manager   : yarn 1.22.22\nOperating System  : win32 x64\n\n┌───────────────────────────┬───────────────────┬───────────────────┐\n│ Package                   │ Installed Version │ Requested Version │\n├───────────────────────────┼───────────────────┼───────────────────┤\n│ @angular/build            │ 22.2.7            │ 22.2.7            │\n│ @angular/cli              │ 22.2.7            │ 22.2.7            │\n│ @angular/common           │ 22.2.6            │ 22.2.6            │\n│ @angular/compiler         │ 22.2.6            │ 22.2.6            │\n│ @angular/compiler-cli     │ 22.2.6            │ 22.2.6            │\n│ @angular/core             │ 22.2.6            │ 22.2.6            │\n│ @angular/forms            │ 22.2.6            │ 22.2.6            │\n│ @angular/platform-browser │ 22.2.6            │ 22.2.6            │\n│ rxjs                      │ 7.8.2             │ 7.8.2             │\n│ typescript                │ 6.0.3             │ ~6.0.3            │\n└───────────────────────────┴───────────────────┴───────────────────┘\n```\n\n### Anything else?\n\n#72065 looks related but is a different problem: there the control writes its own model under `[formField]`, and the remembered value in `control_custom.ts` is not updated. Here the control's model is never written; only the raw value of `transformedValue` is.\n","author":{"url":"https://github.com/itsokto","@type":"Person","name":"itsokto"},"datePublished":"2026-11-16T21:04:27Z","url":"https://github.com/angular/angular/issues/72068"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:f7d9bc4a-19d3-c5c7-3c58-6e5b2ab5d117
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB912:97D39:761030:9C280B:6B01DB78
html-safe-nonce9acd2ef0377b8186a242a5ece347371877145b3beab95c9589da34d96da07031
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOTEyOjk3RDM5Ojc2MTAzMDo5QzI4MEI6NkIwMURCNzgiLCJ2aXNpdG9yX2lkIjoiMjgwNTEwNTI3ODEwNDc1NTA2NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac63dcc69d5e7f473b02616225fe4be5c213c22bc5dc112e1b091cffe90ebec202
hovercard-subject-tagissue:6430752441
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/72068/issue_layout
twitter:imagehttps://opengraph.githubassets.com/52119753ff586c132cc689f40f2bff59e1215403d687ddc24c1142c0a32f36bb/angular/angular/issues/72068
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/52119753ff586c132cc689f40f2bff59e1215403d687ddc24c1142c0a32f36bb/angular/angular/issues/72068
og:image:altWhich @angular/* package(s) are the source of the bug? forms Is this a regression? No Description A FormValueControl that uses transformedValue shows an empty input after a reactive form is reset a...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameitsokto
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
go-importgithub.com/angular/angular git https://github.com/angular/angular.git
octolytics-dimension-user_id139426
octolytics-dimension-user_loginangular
octolytics-dimension-repository_id24195339
octolytics-dimension-repository_nwoangular/angular
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id24195339
octolytics-dimension-repository_network_root_nwoangular/angular
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/angular/angular/issues/72068#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F72068
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F72068
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=angular%2Fangular
Reloadhttps://github.com/angular/angular/issues/72068
Reloadhttps://github.com/angular/angular/issues/72068
Reloadhttps://github.com/angular/angular/issues/72068
angularhttps://github.com/angular
angularhttps://github.com/angular/angular
Codehttps://github.com/angular/angular
Issues835 (835)https://github.com/angular/angular/issues
Pull requests142 (142)https://github.com/angular/angular/pulls
Discussionshttps://github.com/angular/angular/discussions
Actionshttps://github.com/angular/angular/actions
Projectshttps://github.com/angular/angular/projects
Security and quality40 (40)https://github.com/angular/angular/security
Insightshttps://github.com/angular/angular/insights
https://github.com/angular/angular
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/72068
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/72068
#72074https://github.com/angular/angular/pull/72074
Reactive forms: transformedValue control shows an empty value after reset() followed by setting the previous valuehttps://github.com/angular/angular/issues/72068#top
#72074https://github.com/angular/angular/pull/72074
area: formshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20forms%22
needsTriagehttps://github.com/angular/angular/milestone/83
https://github.com/itsokto
itsoktohttps://github.com/itsokto
on Nov 16, 2026https://github.com/angular/angular/issues/72068#issue-6430752441
849dba6https://github.com/angular/angular/commit/849dba6c6506c2696a43a3fad6ee459e17b4b6c8
ng_control.tshttps://github.com/angular/angular/blob/1e6afa4cb84c/packages/forms/src/directives/ng_control.ts#L89-L103
transformed_value.tshttps://github.com/angular/angular/blob/1e6afa4cb84c/packages/forms/signals/src/api/transformed_value.ts#L140-L144
ng_control.tshttps://github.com/angular/angular/blob/1e6afa4cb84c/packages/forms/src/directives/ng_control.ts#L381-L387
#72065https://github.com/angular/angular/issues/72065
angular-robothttps://github.com/apps/angular-robot
area: formshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20forms%22
on Nov 16, 2026https://github.com/angular/angular/issues/72068#event-36327368205
angular-robothttps://github.com/apps/angular-robot
needsTriagehttps://github.com/angular/angular/milestone/83
on Nov 16, 2026https://github.com/angular/angular/issues/72068#event-36327371180
ngbothttps://github.com/apps/ngbot
needsTriagehttps://github.com/angular/angular/milestone/83
on Nov 16, 2026https://github.com/angular/angular/issues/72068#event-36327371549
Sign up for freehttps://github.com/signup?return_to=https://github.com/angular/angular/issues/72068
Sign in to commenthttps://github.com/login?return_to=https://github.com/angular/angular/issues/72068
area: formshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20forms%22
needsTriageNo due datehttps://github.com/angular/angular/milestone/83
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.