Topic: MDBDatepicker modal selectDay to confirm and close modal

VDLP priority asked 2 years ago


Hi,

We would like to have the option to confirm and close the modal when a day is selected in the MDBDatepicker component, like the inline version of the datepicker.

With the default datepicker modal, you have to select a date and then click on "Ok" to confirm your selection.

With a new prop we want to automatically confirm the selected date, e.g.: <MDBDatepicker :confirmOnSelect="true" v-model="date" label="Select a date" />

The current code looks like:

const selectDay = (day: Day) => {
  headerDate.value = dayjs(day.dayJS);
  selectedDate.value = headerDate.value;
  focusedDate.value = headerDate.value;

  if (props.inline) {
    ok();
  }
};

But for the new prop could look like:

const selectDay = (day: Day) => {
  headerDate.value = dayjs(day.dayJS);
  selectedDate.value = headerDate.value;
  focusedDate.value = headerDate.value;

  if (props.inline || props.confirmOnSelect) {
    ok();
  }
};

The naming of the prop is just an example, can be named differently.

Kind Regards,

Van der Let & Partners


Bartosz Cylwik staff answered 2 years ago


Hello! Thank you for submitting feature request. We will discuss this with our team and decide if we should add this feature. Best Regards!



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

  • ForumUser: Priority
  • Premium support: Yes
  • Technology: MDB Vue
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: Yes
  • Provided link: No