Topic: mdb-datepicker-toggle still clickable when [disabled] is set

Dave Moniz priority asked 1 year ago


Expected behavior

When you have [disabled]="true" on the <input> and on the <mdb-datepicker-toggle> it means you can't interact with this field

Actual behavior

You very much so still can click on the <mdb-datepicker-toggle> even though it is visually in a disabled state

Resources (screenshots, code snippets etc.)

TS

<mdb-form-control class="input-field">
    <input mdbInput [mdbValidate]="true" id="whenDatePicker" name="whenDatePicker" formControlName="whenControl"
        [mdbDatepicker]="whenDatePicker" [disabled]="announcement.type !== 'event'" type="text" class="form-control"
        (click)="whenDatePicker.open();">
    <label mdbLabel for="whenDatePicker" class="form-label">When</label>
    <mdb-datepicker-toggle [mdbDatepicker]="whenDatePicker" [disabled]="announcement.type !== 'event'"></mdb-datepicker-toggle>
    <mdb-datepicker #whenDatePicker [format]="'mmm d, yyyy'" [minDate]="announcement.when"></mdb-datepicker>
    <mdb-error *ngIf="(whenControl?.invalid && (whenControl?.dirty || whenControl?.touched))">Please pick a date</mdb-error>
    <mdb-success *ngIf="whenControl?.valid && (whenControl?.dirty || whenControl?.touched)"></mdb-success>
</mdb-form-control>

Arkadiusz Idzikowski staff commented 1 year ago

Thank you for letting us know about this bug, we will improve it while working on the problem with disabled state in form controls.



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Opened

Specification of the issue

  • User: Priority
  • Premium support: Yes
  • Technology: MDB Angular
  • MDB Version: MDB5 1.0.0
  • Device: PC
  • Browser: Google Chrome
  • OS: Arch Linux
  • Provided sample code: Yes
  • Provided link: No