[TikiWiki-commits] [Git][tikiwiki/tiki][27.x] [FIX] select: Allow options on Select2 dropdowns to be hidden (as Chosen ones used to do)

"Jonny Bradley \(@jonnybradley\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <69b1b60b8060_3b189ee49314e@gitlab-sidekiq-low-urgency-cpu-bound-v2-6d4b95ff96-z9xw9.mail>

Jonny Bradley pushed to branch 27.x at Tiki Wiki CMS Groupware / Tiki


Commits:
970dd4c9 by Jonny Bradley at 2026-03-11T18:27:59+00:00
[FIX] select: Allow options on Select2 dropdowns to be hidden (as Chosen ones used to do)
---
* [FIX] select: Allow options on Select2 dropdowns to be hidden (as Chosen ones used to do)

See merge request tikiwiki/tiki!9734

- - - - -


1 changed file:

- lib/jquery_tiki/tiki-jquery.js


Changes:

=====================================
lib/jquery_tiki/tiki-jquery.js
=====================================
@@ -1371,6 +1371,13 @@ $.fn.tiki = function(func, type, options, excludepage) {
                         $el.text(obj.text);
                         return $el;
                     },
+                    templateResult: function (option) {
+                        // hide options if display:none or hidden
+                        if (option.element && (option.element.style.display === "none" || option.element.hasAttribute("hidden"))) {
+                            return null;
+                        }
+                        return option.text;
+                    },
                 };
                 // Adds and/or merge more options
                 $.extend(opts, options);



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

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/970dd4c998d4754910ae02b9cbb66caa2bb85548
You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help

_______________________________________________
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.