News for hackers. Stuff that matters.
Re:Customizable HTML Select by deanc on Thursday February 20, 2025 @01:34PM (#43118331)
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.
Re:Customizable HTML Select by hassleblad23 on Thursday February 20, 2025 @02:09PM (#43118779)
I think we should welcome all efforts to have a standardized, modern select component in the HTML spec. Would save a lot of trouble.
Re:Customizable HTML Select by deanc on Sunday February 23, 2025 @11:41AM (#43150688)
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.
Re:Customizable HTML Select by crab_galaxy on Thursday February 20, 2025 @01:46PM (#43118477)
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.
Re:Customizable HTML Select by bmk44 on Thursday February 20, 2025 @04:42PM (#43120638)
Even with an average software engineer compensation, you probably got paid a lot more than a penny for every custom "select" you implemented :)
Re:Customizable HTML Select by mopsi on Thursday February 20, 2025 @05:33PM (#43121229)
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.
Re:Customizable HTML Select by troupo on Thursday February 20, 2025 @07:38PM (#43122622)
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
Re:Customizable HTML Select by asadotzler on Thursday February 20, 2025 @10:36PM (#43123730)
This is the correct answer, if perhaps too optimistic on there being two of them.