debug: add logging to verify tomselect option detection

This commit is contained in:
2026-05-01 14:23:45 -04:00
parent 239ee20397
commit 9e2c50a9ee
@@ -6,14 +6,17 @@
</style> </style>
<script src="https://cdn.jsdelivr.net/npm/tom-select@2.4.3/dist/js/tom-select.complete.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/tom-select@2.4.3/dist/js/tom-select.complete.min.js"></script>
<script> <script>
document.addEventListener("DOMContentLoaded", function () { document.addEventListener("DOMContentLoaded", () => {
document.querySelectorAll('select').forEach((el) => { document.querySelectorAll('select').forEach((el) => {
if (el.tomselect) return; if (el.tomselect) return;
console.log('Initializing TomSelect on:', el.id, 'Options:', el.options.length);
new TomSelect(el, { new TomSelect(el, {
copyClassesToDropdown: false, copyClassesToDropdown: false,
dropdownParent: 'body', dropdownParent: 'body',
controlInput: '<input>', controlInput: '<input>',
sortField: [{ sortField: {
field: 'text', field: 'text',
direction: 'asc', direction: 'asc',
func: function(a, b) { func: function(a, b) {
@@ -21,7 +24,7 @@
const numB = parseInt(b.text, 10); const numB = parseInt(b.text, 10);
return numA - numB; return numA - numB;
} }
}] }
}); });
}); });
}); });