Topic: mdb-date-picker setValue(null) does not work

JeroenVunderink premium asked 3 years ago


** Backgound * In my UI is have a checkbox that enables or disables field. When the checkbox is set to false a few input fields are het to either false, null or "". The datePicker is one of them.

When the checkbox is set to false in the TS file I set the Date Picker value to null, like what happens when clicking the clear field in the UI of the datePicker.

The value of the field is indeed set to null (like via the UI) but the datePicker on the screen is not updated accordingly to the new value, to explain better when NULL the placeholder show be displayed. Setting any other date works fine, but I would like it the datepicker to work properly including the placeholder.

Expected behavior

this.form.controls.maxdate.setValue(null);

will show the placeholder on the screen:

[placeholder]="'Select max date'"

Actual behavior The previous value is still shown.

Resources (screenshots, code snippets etc.) See above.


Arkadiusz Idzikowski staff commented 3 years ago

Thank you for letting us know about this problem. It is something that we need to fix on our end. Unfortunately, there is no easy workaround for now.



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

  • ForumUser: Premium
  • Premium support: Yes
  • Technology: MDB Angular
  • MDB Version: 9.3.1
  • Device: MacAir
  • Browser: Chrome
  • OS: MacOS
  • Provided sample code: No
  • Provided link: No