Holiday Notice: Support will be provided on a limited scale from December 24th, 2024, to January 2nd, 2025. Happy holidays and a wonderful New Year!


Topic: Close date picker after selecting the date

aionys pro asked 6 years ago


Hello, Is it possible to close date picker automatically once the date is selected there, so I don't need to click close button or outside of date picker are?

Gayatri Dube free answered 4 years ago


how to close datepicker after selecting date ?


Arkadiusz Idzikowski staff commented 4 years ago

You need to set 'closeAfterSelect' option to true. You can find guide for options usage here:

https://mdbootstrap.com/docs/angular/forms/date-picker/#options


Arkadiusz Idzikowski staff answered 5 years ago


You need to add [disabled]="true" input to your mdb-date-picker component and use 'openBtnClicked' method to open date picker programatically. We explained how to use component methods in our documentation (change tab to API at the top of the page):

Angular date picker


Diego Alvarez free commented 5 years ago

Thanks, but it is also required that the entry field is enabled, and additional that can be opened from a button the selector (this I already did), but that when doing the focus event, there will be no selector but if I can enter the entry field


Diego Alvarez free commented 5 years ago

This event (inputFocusBlur) only works for the focusout and does not work for the focus, how can I get it to the focus event


Arkadiusz Idzikowski staff commented 5 years ago

I'm afraid there is no way to disable only click on the input field, without disabling the focus.


Diego Alvarez free commented 5 years ago

The event onFocus no working, why?, only working the event onFocusOut, the event onFocus never triggers, any solution?


Arkadiusz Idzikowski staff commented 5 years ago

We will take a closer look at the problems with focus.


Diego Alvarez free commented 5 years ago

thank you very much, I will be attentive


Diego Alvarez free answered 5 years ago


Good evening, how can I make the datepicker not open if not until I say, that by a button I can only open it, but when I click on the entry field it will never open


Damian Gemza staff answered 6 years ago


Dear aionsys, For now, it's not implemented, but you can implement this to your project using code from below. In next release, we'll implement this feature as ready to use. Quick workaround: Head into your pro/date-picker/datepicker.component.ts file, and search for selectDate(date: IMyDate) method. In this method at the end paste those two lines to close datepicker after selecting an date:
this.showSelector = false;

this.removeInlineStyle();
In next release, it will be available by using closeAfterSelect: true option in myDatePickerOptions object in app.component.ts.
Best Regards,
Damian

aionys pro commented 6 years ago

Hello Damian, When do you plan to release new version?

Damian Gemza staff commented 6 years ago

Dear aionsys, ETA for next release is about 3 weeks. We want to release new version of MDB Angular with compatibility with Angular 6. This fix is available to download from our GitLab branch dev, so you can always update your project by using dev branch instead of master. Best Regards, Damian

aionys pro commented 6 years ago

Thanks Damian for the help.


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: Pro
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No
Tags