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


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

Dave Moniz pro premium priority asked 5 months 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 5 months 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.
Status

Open

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