News for hackers. Stuff that matters.
Re:Common Beginner Mistakes with React by paulddraper on Saturday March 11, 2023 @08:39PM (#35115371)
That works until you need something crazy like a searchable drop-down.
Re:Common Beginner Mistakes with React by cvdub on Saturday March 11, 2023 @09:04PM (#35115568)
Is that sarcasm? It’s not hard to implement a searchable dropdown in vanilla JS.
Re:Common Beginner Mistakes with React by dham on Saturday March 11, 2023 @09:46PM (#35115903)
select boxes are searchable by default. Just isn't obvious. You can also use a datalist
Re:Common Beginner Mistakes with React by onion2k on Saturday March 11, 2023 @11:34PM (#35116706)
This 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/da...
Re:Common Beginner Mistakes with React by squeaky-clean on Sunday March 12, 2023 @01:55AM (#35117508)
On 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.
Re:Common Beginner Mistakes with React by robertoandred on Sunday March 12, 2023 @10:12PM (#35129932)
And datalists are incredibly limited in functionality and styling.
Re:Common Beginner Mistakes with React by onion2k on Monday March 13, 2023 @04:59AM (#35132983)
Sure, 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.