Topic: mdb-date-picker 1 click select

itay pro asked 5 years ago


Hi, How can I set an mdb-date-picker element so that a click on date will select and close it, instead of waiting for the user to somehow figure out how to close it

Damian Gemza staff answered 5 years ago


Dear mdb2, There's option in Datepicker Component to achieve your desired behavior. Just add closeAfterSelect: true parameter into Datepicker options object. Please see come below: HTML
<mdb-date-picker name="mydate" [options]="myDatePickerOptions" [placeholder]="'Selected date'" [(ngModel)]="model" required></mdb-date-picker>
And in ts file, please add :
public myDatePickerOptions: IMyOptions = {

closeAfterSelect:true

};
After that, your datepicker will close after selecting a date. Best Regards, Damian

Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Resolved

Specification of the issue

  • ForumUser: Pro
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No
Tags