DatePicker: Date is not correctly updated with Steppers


Topic: DatePicker: Date is not correctly updated with Steppers

dimitribocquet pro asked 6 years ago

Hi,

I'm using the Datepicker with Steppers and a custom locale, and when I switch to another step, the Datepicker field doesn't work anymore.

Moreover, I tried to manually update the value, it doesn't work neither. I have to do that, with this ugly setTimeout :

        switch (this.activeStep) {
            case 2:
                this.startAtPicker.addLocale(app.locales);
                setTimeout(() => {
                    this.startAtPicker.writeValue(this.modalForm.get('harvest.start_at').value);
                }, 1);
            break;

            case 3:
                this.finishAtPicker.addLocale(app.locales);
                setTimeout(() => {
                    this.finishAtPicker.writeValue(this.modalForm.get('harvest.finish_at').value);
                }, 1);

            break;
        }
 
Because I'm using Steppers with *ngIf, the datePicker DOM disappears if we are not on it step. I have to add locales again, etc.

Please could you fix that?
 
Thanks. 

Arkadiusz Idzikowski staff answered 6 years ago

Hello,

Thank you for reporting this problem, we will take a closer look at it. 

By 'Datepicker field doesn't work anymore' you mean that the picker frame doesn't open at all or that locales are not updated? 


Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Answered

Specification of the issue
  • User: Pro
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: 6.2.3
  • Device: Mac
  • Browser: Chrome
  • OS: OSX
  • Provided sample code: Yes
  • Provided link: No