Comment by hk1337
Comment by hk1337 5 days ago
datalist is one I stumbled upon and blew me away. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/da...
It's not a replacement for select as you still need an input to tie it to but it seems to handle filtering a list of options nicely.
Also, if you have two selects with the same list in it, you can do it once with datalist and have two inputs, say a list of clients with client_a and client_b for inputs.
I don't quite care for how it displays the value, like if you put the ID as the value and the client name in the option element, you can filter by the ID or the name but the input will show the ID only.
My frown continues to deepen at Apple's UI backslide as they crib more and more junk from iOS/iPadOS. I'm on Sonoma 14.5, and this is Safari 17.5.
macOS Safari's <select>: https://imgur.com/a/05YWDCc
macOS Safari's <datalist>: https://imgur.com/a/4f3JwuA
There are SO, SO, SO many things wrong with Safari's datalist element here. Esc doesn't close it (close from keyboard by switching tabs...). There's no hover effect on the options. The active background color is more saturated than the system's accent color (typical for iPadOS/Catalyst junk). There's no left/right margin, and no border radius, on the options. Option text isn't vertically centered. The font is different (it seems differently aliased? Perhaps just larger). The datalist element itself lacks the same border-radius of select. On select elements, selection does not wrap (down arrow with the last option active); on datalist it does.
Here's an egregious one - when you zoom in with Cmd-+ a few times, this is how the <select> element looks: https://imgur.com/a/Vpu536j
And this is <datalist>: https://imgur.com/a/JrfXLW9
Argh! I used to revere Apple for sweating the details. Their UI/UX quality inspired me to become a frontend dev.
Today, they ship things that wouldn't pass Q/A at my worst jobs.