[TikiWiki-commits] [Git][tikiwiki/tiki][master] [FIX] datepickers: Use jQuery `on` handlers for better event handling as it...

"Jonny Bradley \(@jonnybradley\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <698cbef6b2587_3b1d81db843759@gitlab-sidekiq-low-urgency-cpu-bound-v2-68c7d7f89f-sppvl.mail>

Jonny Bradley pushed to branch master at Tiki Wiki CMS Groupware / Tiki


Commits:
cd3e80dd by Jonny Bradley at 2026-02-11T17:31:44+00:00
[FIX] datepickers: Use jQuery `on` handlers for better event handling as it...
---
* [FIX] datepickers: Use jQuery `on` handlers for better event handling as it doesn't fail fatally if `element[0]` is null (and the rest of the function already uses jQuery anyway)

See merge request tikiwiki/tiki!9537

- - - - -


1 changed file:

- src/js/@tiki/ui-utils/handleDatePicker.js


Changes:

=====================================
src/js/@tiki/ui-utils/handleDatePicker.js
=====================================
@@ -19,7 +19,7 @@ export default function handleDatePicker(selector, options) {
         element.after(inputEndDateHolder);
     }
 
-    element[0].addEventListener("change", (e) => {
+    element.on("change", (e) => {
         const value = e.detail[0];
         if (Array.isArray(value)) {
             inputDateHolder.attr("value", moment(value[0]).unix());
@@ -38,7 +38,7 @@ export default function handleDatePicker(selector, options) {
 
     if (element.attr("custom-timezone") === "true") {
         element.after(inputTimezoneHolder);
-        element[0].addEventListener("timezoneChange", (e) => {
+        element.on("timezoneChange", (e) => {
             inputTimezoneHolder.attr("value", e.detail[0]);
         });
     }



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/cd3e80ddddf0a07a02528a5e93014107a9eb9f36

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/cd3e80ddddf0a07a02528a5e93014107a9eb9f36
You're receiving this email because of your account on gitlab.com.

_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.