debug: add logging to verify tomselect option detection
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}]
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user