Comment by deanc
4 months ago
I've been doing front-end since the days of IE5 and I'd be rich if I had a penny for every time I've had to do a custom "select". It's a pain to use third-party libraries for this, but it _is_ a solved problem and doesn't require that much extra code.
I think we should welcome all efforts to have a standardized, modern select component in the HTML spec. Would save a lot of trouble.
We have one and have had one for years. It uses the OS's default design, which is familiar to users. Instead, we have had decades of people hacking together whatever is the trend of the day into a custom designed select-box, often providing poor accessibility and usability. The absolute worst offender of these has to be on mobile where iOS has its native control and many designs implement custom select's which don't trigger that.
Which libraries have solved this problem? I recently tried several of the most recommended standalone JS libraries for implementing a <select> with icons and a custom layout, but each single one of them was seriously lacking in some way.
Even with an average software engineer compensation, you probably got paid a lot more than a penny for every custom "select" you implemented :)
It's not a solved problem. There are maybe two libraries out there that are customizable, performant, and don't break things like keyboard navigation and accessibility
This is the correct answer, if perhaps too optimistic on there being two of them.
Yeah the problem is when you need to create a custom select without using a 3rd party library, and you want to make sure the interactions are accessible and up to parity with native selects. Then you have to add tons of event handlers, aria attributes, refs for handling outside clicks, etc etc.