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>
<script src="https://cdn.jsdelivr.net/npm/tom-select@2.4.3/dist/js/tom-select.complete.min.js"></script>
<script>
document.addEventListener("DOMContentLoaded", function () {
document.addEventListener("DOMContentLoaded", () => {
document.querySelectorAll('select').forEach((el) => {
if (el.tomselect) return;
console.log('Initializing TomSelect on:', el.id, 'Options:', el.options.length);
new TomSelect(el, {
copyClassesToDropdown: false,
dropdownParent: 'body',
controlInput: '<input>',
sortField: [{
sortField: {
field: 'text',
direction: 'asc',
func: function(a, b) {
@@ -21,7 +24,7 @@
const numB = parseInt(b.text, 10);
return numA - numB;
}
}]
}
});
});
});