Topic: Datetimepicker: Datepicker throws Javascript exception when selecting a date
ikan_nak
priority
asked 1 month 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).
Kamila Pieńkowska
staff
answered 1 month ago
The error does not occur in the snippet. Can you describe how to reproduce it?
ikan_nak priority commented 3 weeks 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 3 weeks 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.
Kamila Pieńkowska staff commented 3 weeks ago
I wasn't able to get this error no matter what browser I tried. Do you have any extensions or custom settings?
ikan_nak priority commented 3 weeks ago
I do not have any extensions or custom settings. I even tried the snippet in Firefox in troubleshooting mode, as well as in a refreshed installation with default settings and no extentions, and I still got the Firefox equivalent of that error in the console. I've made a gif and hosted it on another site, I'll edit it into the question.
ikan_nak priority commented 3 weeks ago
So I've done some additional testing as well. I do my development on a Windows 10 VM on a remote server with relatively old hardware (10 year old CPU). I cannot replicate this issue myself when opening the snippet in a browser in the client machine. it appears to be some sort of race condition caused by the combination of slower hardware and higher input latency.
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- 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