valor-software / ngx-bootstrap

Fast and reliable Bootstrap widgets in Angular (supports Ivy engine)
https://valor-software.com/ngx-bootstrap
MIT License
5.52k stars 1.69k forks source link

Datepicker - [isDisabled] is not working when using formControlName #6576

Closed maxcl10 closed 2 weeks ago

maxcl10 commented 1 year ago

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.

vaibhav915 commented 1 year ago

@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 ?

alewebcode commented 11 months ago

The property [isDisabled]="isDisabled" disabled only dates of component.One solution for this situation is use attr.disabled on input

tuanbjnh commented 11 months ago

This is an issue of Angular 15 https://github.com/angular/angular/issues/48350

lexasq commented 2 weeks ago

You got to provide disable attribute for form-controls in your component.ts now