Topic: Datetimepicker: Datepicker throws Javascript exception when selecting a date

ikan_nak priority asked 1 week ago


Expected behavior

I do not expect random TypeErrors during use.

Actual behavior

When selecting a date in a Datepicker as part of a datetimepicker element, the Datepicker throws an uncaught TypeError during the updating of the header date. More precisely, it tries to call querySelector on a null element, with the null element supposedly being the container object.

mdb.umd.min.js:20 
 Uncaught TypeError: Illegal invocation
    at Object.findOne (mdb.umd.min.js:20:7124)
    at _b._updateHeaderDate (mdb.umd.min.js:39:303913)
    at _b._handleDateSelection (mdb.umd.min.js:39:303788)
    at HTMLDivElement.<anonymous> (mdb.umd.min.js:39:303356)
    at HTMLDivElement.i (mdb.umd.min.js:20:4008)


Resources (screenshots, code snippets etc.)

Snippet that shows the error: https://mdbootstrap.com/snippets/standard/ikan_nak/6380644 (use the browser console to view the error).

Snippet showing the error


Kamila Pieńkowska staff answered 1 week ago


The error does not occur in the snippet. Can you describe how to reproduce it?


ikan_nak priority commented 16 hours ago

Open the snippet, then open the browser's console. then click on the datetimepicker to open the datepicker. Select any date, and it will cause an error in the browser console. The error does not get tracked by the"console errors" counter below the snippet.


ikan_nak priority commented 16 hours ago

I have added a screenshot, but there's an error on your usercontent.mdbootstrap.com domain related to the TLS certificate. YOu might be able to see it on your servers, but it won't show in the browser.



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 Standard
  • MDB Version: MDB5 8.1.0
  • Device: Desktop computer
  • Browser: Edge
  • OS: Windows 11
  • Provided sample code: No
  • Provided link: Yes