Needed a searchable select dropdown box and found a TomSelect library that has it all set up. I added in the required library. More specifically, this solution here.
<link href="https://cdn.jsdelivr.net/npm/tom-select@2.0.0-rc.4/dist/css/tom-select.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/tom-select@2.0.0-rc.4/dist/js/tom-select.complete.min.js"></script>
added in the JS code
new TomSelect("#select-state",{
create: false,
sortField: {
field: "text",
direction: "asc"
}
});
and everything works fine as intended until I realised that TomSelect filters out my text in said HTML dropdown selection.
If one of my dropdown selection was meant to say: 1 - this is option "hello"
then after implementing the TomSelect, it says instead this is option
, I assume filtering out elements before and after keys like - and ".
Would love to know to disable this filter, or at least modify it so that the whole text of the option is displayed otherwise the point of a dropdown is sort of defeated.
I was thinking of maybe tackling the attributes such as field: "text"
but I have no idea where to begin or what other options could be. What would these SoftField option be?