ngx-bootstrap
ngx-bootstrap copied to clipboard
Datepicker - [isDisabled] is not working when using formControlName
Bug description:
I'm using the datepicker control in a reactive form. The control is working fine. However, in some cases I want to disable the control. I added the following code.
[isDisabled]="isDisabled"
but the control is still enabled. I was able to figure out that the issue comes from the fromControlName property. If I remove the formControlName attribute, then the datepicker is correctly disabled.
Versions of ngx-bootstrap, Angular, and Bootstrap:
ngx-bootstrap: 10.2.0 and 10.3.0
Angular: 15
Bootstrap: 5
Expected behavior
The datepicker must be disabled.
@maxcl10 Similar issue, we have upgraded to Angular 15 and ngx-bootstrap to 10.x.x and Bootstrap to 5.x.x Is there any other way except removing fromControlName ?
The property [isDisabled]="isDisabled" disabled only dates of component.One solution for this situation is use attr.disabled on input
This is an issue of Angular 15 https://github.com/angular/angular/issues/48350
You got to provide disable attribute for form-controls in your component.ts now