fastselect
fastselect copied to clipboard
Is there anybody using fastselect ? and share knowledge here
Is there anybody using fastselect ? and share knowledge here
many question not answered here
Not many people using it. However, It looks like a good plugin.
I've started using it for a new project, impressed so far, but I'm just having an issue with the placeholder text, in that it always defaults to the first option (/)(;,,;)(/)
@Latchy I'm having that same issue as well with the placeholder text. Were you able to find a solution?
@Latchy , I did a little more digging and I found a solution.
The issue is that the fastselect script searches the select options for one with the attribute "selected: true" (line 120 in fastselect.js). By default, this option is set to the first option in a list that's not disabled. In a non-fastselect situation, you could do the trick of adding "disabled selected" to the select option on top, but with fastselect that doesn't help since it seems to ignore the "disabled" status when it generates disabled options as a "fstResultItem".
So, to bypass this I had to change the value of the select element to an empty string prior to fastselect running.
For my situation, the code looked like this:
$("#projectList").val(""); // clear value selected by default to make way for placeholder
$("#projectList").fastselect({
placeholder: 'Select a Project',
searchPlaceholder: 'Search...'
});
I hope that helps. Let me know if you have any questions.
@pezmo
Hi there, thanks for the update. I moved to using the select2 plugin, hacked the CSS and found it to work just as well, if not better? Though, I tried so many plugins I forgot the issues I was having with either at the time entirely.
If you need some assistance with that plugin, let me know.
https://select2.org/