Title: Warning regarding "disabled" property of [formControl] family of directives refers to behavior thats specific to a subset of ControlValueAccessors, but shows up for all of them · Issue #57793 · angular/angular · GitHub
Open Graph Title: Warning regarding "disabled" property of [formControl] family of directives refers to behavior thats specific to a subset of ControlValueAccessors, but shows up for all of them · Issue #57793 · angular/angular
X Title: Warning regarding "disabled" property of [formControl] family of directives refers to behavior thats specific to a subset of ControlValueAccessors, but shows up for all of them · Issue #57793 · angular/angular
Description: Which @angular/* package(s) are the source of the bug? forms Is this a regression? No Description I have a custom component implementing ControlValueAccessor that wraps around native so that I can provide more cust...
Open Graph Description: Which @angular/* package(s) are the source of the bug? forms Is this a regression? No Description I have a custom component implementing ControlValueAccessor that wraps around native ` so that I can provide more custom design, which is a common task. Radio buttons of a group work with same formControl instance with the way things are implemented in my case. The inner `\u003cinput type=\"radio\" />` does NOT use RadioControlValueAccessor.\r\n\r\nI let my custom component have 'disabled' Input and I do document that when this input is disabled=true then that takes precedence over the status of the form control (that it gets provided through [formControl], [formControlName], etc...), otherwise form control status is the one in effect. This works just fine for selectively disabling single radio buttons, yet, I get the warning from https://github.com/angular/angular/blob/55e3a3a47cddefebc28af03ce58ece136d41a391/packages/forms/src/directives/reactive_directives/form_control_directive.ts#L94 of \r\n\r\n> It looks like you're using the disabled attribute with a reactive form directive. If you set disabled to true\r\n when you set up this control in your component class, the disabled attribute will actually be set in the DOM for\r\n you. We recommend using this approach to avoid 'changed after checked' errors.\r\n \r\nBut thats not true, because that effect may not happen for ControlValueAccessors that are implemented outside Angular, unlike eg.: RadioControlValueAccessor, see\r\nhttps://github.com/angular/angular/blob/55e3a3a47cddefebc28af03ce58ece136d41a391/packages/forms/src/directives/radio_control_value_accessor.ts#L244.\r\n\r\nBut thats not the accessor I am using anywhere in my code, so this warning still shows up, even though its not related to my usecase, where the behavior is well documented.\r\n\r\nSo now I have to:\r\n1) Be stuck with the warning, even though its false positive\r\n2) Use a different name other than \"disabled\"\r\n\r\nCould the warning be moved away from [formControl] directives, to the subclasses of BuiltInControlValueAccessor that actually do the disabled prop writing behavior instead?\r\n\r\n\r\n### Please provide a link to a minimal reproduction of the bug\r\n\r\nhttps://stackblitz.com/edit/stackblitz-starters-x9t7mb?file=src%2Fmain.ts\r\n\r\nVery simple empty implementation of ControlValueAccessor with a disabled input. Note the warning in console which is not actually relevant.\r\n\r\n### Please provide the exception or error you saw\r\n\r\n_No response_\r\n\r\n### Please provide the environment you discovered this bug in (run `ng version`)\r\n\r\n```true\r\n@angular/forms: 17.0.9\r\nNode v22.1.0\r\nNpm 10.7.0\r\n```\r\n\r\n\r\n### Anything else?\r\n\r\n_No response_","author":{"url":"https://github.com/Erbenos","@type":"Person","name":"Erbenos"},"datePublished":"2024-09-12T17:02:33Z","url":"https://github.com/angular/angular/issues/57793"}
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:b3809d9f-fa3d-a846-d3bb-f3f94106ff4b current-catalog-service-hash 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 request-id A8D0:269AD9:1AB4C42:23A5EE4:6B0159A6 html-safe-nonce b2c2c99023067f5bb3a36c0238c33d42a28ef68764c5201cf7ee8d2ebc4b932a visitor-payload eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOEQwOjI2OUFEOToxQUI0QzQyOjIzQTVFRTQ6NkIwMTU5QTYiLCJ2aXNpdG9yX2lkIjoiMzgyNDcyNTUzMjAxMzA1ODQ3MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 visitor-hmac 60d2958b442f8b7ccdb2eaf9bbeb479a12fe37357e521ea8c07a6de2153e51c6 hovercard-subject-tag issue:2522918425 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/57793/issue_layout twitter:image https://opengraph.githubassets.com/1c7ee878b696ec75ce5bfbb951cf50a5b536e8862df42ea900906e01293dacde/angular/angular/issues/57793 twitter:card summary_large_image og:image https://opengraph.githubassets.com/1c7ee878b696ec75ce5bfbb951cf50a5b536e8862df42ea900906e01293dacde/angular/angular/issues/57793 og:image:alt Which @angular/* package(s) are the source of the bug? forms Is this a regression? No Description I have a custom component implementing ControlValueAccessor that wraps around native https://github.com/angular/angular/issues/57793#top area: forms https://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20forms%22 needsTriage https://github.com/angular/angular/milestone/83 https://github.com/Erbenos Erbenos https://github.com/Erbenos on Sep 12, 2024 https://github.com/angular/angular/issues/57793#issue-2522918425 angular/packages/forms/src/directives/reactive_directives/form_control_directive.ts https://github.com/angular/angular/blob/55e3a3a47cddefebc28af03ce58ece136d41a391/packages/forms/src/directives/reactive_directives/form_control_directive.ts#L94 55e3a3a https://github.com/angular/angular/commit/55e3a3a47cddefebc28af03ce58ece136d41a391 angular/packages/forms/src/directives/radio_control_value_accessor.ts https://github.com/angular/angular/blob/55e3a3a47cddefebc28af03ce58ece136d41a391/packages/forms/src/directives/radio_control_value_accessor.ts#L244 55e3a3a https://github.com/angular/angular/commit/55e3a3a47cddefebc28af03ce58ece136d41a391 https://stackblitz.com/edit/stackblitz-starters-x9t7mb?file=src%2Fmain.ts https://stackblitz.com/edit/stackblitz-starters-x9t7mb?file=src%2Fmain.ts pkozlowski-opensource https://github.com/pkozlowski-opensource area: forms https://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20forms%22 on Sep 13, 2024 https://github.com/angular/angular/issues/57793#event-14246753563 ngbot https://github.com/apps/ngbot needsTriage https://github.com/angular/angular/milestone/83 on Sep 13, 2024 https://github.com/angular/angular/issues/57793#event-14246753977 https://github.com/Erbenos Erbenos https://github.com/Erbenos on Sep 18, 2024 https://github.com/angular/angular/issues/57793#issuecomment-2359225383 https://github.com/JeanMeche JeanMeche https://github.com/JeanMeche on Oct 29, 2026 https://github.com/angular/angular/issues/57793#issuecomment-6511308981 JeanMeche https://github.com/JeanMeche not planned https://github.com/angular/angular/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Anot-planned on Oct 29, 2026 https://github.com/angular/angular/issues/57793#event-34643694438 Sign up for free https://github.com/signup?return_to=https://github.com/angular/angular/issues/57793 Sign in to comment https://github.com/login?return_to=https://github.com/angular/angular/issues/57793 area: forms https://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20forms%22 needsTriageNo due date https://github.com/angular/angular/milestone/83
https://github.com Terms https://docs.github.com/site-policy/github-terms/github-terms-of-service Privacy https://docs.github.com/site-policy/privacy-policies/github-privacy-statement Security https://github.com/security Status https://www.githubstatus.com/ Community https://github.community/ Docs https://docs.github.com/ Contact https://support.github.com?tags=dotcom-footer
Viewport: width=device-width