opening datepicker with JS not working


Topic: opening datepicker with JS not working

root-nine pro premium priority asked 5 years ago

Expected behavior When calling pickadate("open") on an editable date picker the picker shoud open.

Actual behavior Nothing happens. The input is editable but the picker does not appear

Resources (screenshots, code snippets etc.) https://mdbootstrap.com/snippets/jquery/inforoot-nine-de/1016834


MDBootstrap staff pro premium priority answered 5 years ago

Hi root-nine,

I forked snippet from your example and fixed this functionality: https://mdbootstrap.com/snippets/jquery/pjoter-2-0/1025443

If you need additional help I am here for you.

Best Regards, Piotr


root-nine pro premium priority answered 5 years ago

Hi Piotr,

this isn´t working. I have to click twice to open the picker. When i select a date I can click on the button twice or more, but it doesn´t open the picker anymore.


MDBootstrap staff pro premium priority commented 5 years ago

Oh, sorry. That is because of editable: true option in the picker. I believe that merging this 2 functionalities together is really unintuitive for the users because when you actually want to edit something you should click on this specific field to type in your changes and that's why we didn't expect such functionality. I think that you can change the behaviour of this component to serve your needs but we do not support wrong UX practice and I can't change this component behaviour according to what you request. I hope you understand me.


root-nine pro premium priority commented 5 years ago

Well I don´t think it´s unintuitive. We have a lot of customers who prefer working with the keyboard, others prefer working with the mouse. So with the two options mixed I can serve both needs. I have our application in production environment with MDB 4.7.6 where this setting is working and that currently stops me from upgrading to 4.8.8.


MDBootstrap staff pro premium priority commented 5 years ago

I understand. If you want to change the behaviour of this component and still have the same functionality you can modify this part of mdb.js package or work with double-clicking on the input. You can always programmatically trigger 2nd click on 1st click if you want to have a quick fix to this issue without modifying any source code. Sorry for the inconvenience. We didn't plan this 2 functionalities working together. I will see if we can modify this to serve this functionality in the future.


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: Yes
  • Technology: MDB jQuery
  • MDB Version: 4.8.5
  • Device: PC
  • Browser: Chrome, Edge, Firefox
  • OS: Windows 10
  • Provided sample code: No
  • Provided link: Yes
Tags