New Datepicker dont open the calendar by clicking in the inp


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

KeHa asked 4 months 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 4 months ago

Hello,

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

Regards, Marcin


KeHa answered 4 months 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 4 months 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


Please insert min. 20 characters.
Status

Answered

Specification of the issue
  • User: Free
  • Premium support: No
  • Technology: jQuery
  • MDB Version: 4.19.1
  • Device: Laptop
  • Browser: All
  • OS: Win 10
  • Provided sample code: No
  • Provided link: Yes
Tags