Open silveoj opened 1 year ago
Try setting disabled when building your form group:
this.form = this.formBuilder.group({ switch: { value: true, disabled: true }, radio: 'val1', toggle: 'val1', });
I don't use the formBuilder so the syntax may not be perfect. You shouldn't need the [disabled] attribute.
Hi @silveoj you should change the
ReactiveFormModule
to
ReactiveFormsModule.withConfig({callSetDisabledState: 'whenDisabledForLegacyCode'})
@critchie It will works for all radioinput. Sorry, I provided simple example.
@volvachev Thanks. It works. Sorry for interruption. I didn't check pure angular.
@cetincakiroglu @mehmetcetin01140 Any plans to solve this issue?
Describe the bug
I tested my code in stackblitz examples from documentation (examples for Angular 13 and primeng 13). It works. For example it based on https://stackblitz.com/edit/primeng-inputswitch-demo?file=README.md
Issue:
[disabled]="true"
doesn't work in inputSwitch, radioButton, toggleButton, etc (I think in all components) if I use reactive forms. But for ngModel is fine.Fro example I want to disable only one radio from group
package.json
app.module.ts
app.component.ts
app.component.html
Environment
win 10
Reproducer
No response
Angular version
15.*
PrimeNG version
15.*
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
14.20.1
Browser(s)
any
Steps to reproduce the behavior
package.json
,app.module.ts
,app.component.ts
,app.component.html
.npm i
Expected behavior
I can't change/click value of all Reactive controls in
Angular 15
+primeng 15