3 ms·
That works until you need something crazy like a searchable drop-down.
by paulddraper 4y ago
That works until you need something crazy like a searchable drop-down.
- cvdub 4y agoIs that sarcasm? It’s not hard to implement a searchable dropdown in vanilla JS.
- dham 4y agoselect boxes are searchable by default. Just isn't obvious. You can also use a datalist
- onion2k 4y agoThis is where a good understanding of HTML helps - you can use a fatalist instead of a select. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist https://developer.mozilla.org/en-US/docs/Web/HTML/Element/da...
- squeaky-clean 4y agoOn mobile (safari) it doesn't show results as you type. You have to type your partial string and then press the dropdown selector to see the list filtered by your string.
- robertoandred 4y agoAnd datalists are incredibly limited in functionality and styling.
- onion2k 4y agoSure, so if you need more functionality or different styling they won't work. But I suspect many devs reach for a JS searchable dropdown replacement without even bothering to ask the question of whether they really need something else.