Topic: New Datepicker dont open the calendar by clicking in the input field

KeHa priority asked 3 years ago


Expected behavior At the old datepicker you could press into the input field and the calendar is opening.

Actual behavior At new datepicker you press in the input field and the calander is not opening, but you can write down everything in this input field like abcde and this is not a valide date.

Resources (screenshots, code snippets etc.)


Marcin Luczak staff answered 3 years ago


Hi,

Yes, this is desirable functionality as someone might want to enter the date themselves. You can change this by adding on('click') listener to your input and in the callback mock icon click:

$('#example').on('click', function(e) {
  $('.input-prefix').click()
})

This should prevent from being able to type inside the input.

Regards, Marcin


KeHa priority answered 3 years ago


Thx for response,

thats true but is this not a issue that we are able to write in this input field a random text ?

Thats means you want not change this funktionallity ?

Thx Kevin


Marcin Luczak staff answered 3 years ago


Hello,

The new Datepicker opens on the icon click on the right side of the input, not the input itself.

Regards, Marcin



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 jQuery
  • MDB Version: 4.19.1
  • Device: Laptop
  • Browser: All
  • OS: Win 10
  • Provided sample code: No
  • Provided link: Yes