logoalt Hacker News

deanclast Thursday at 6:34 PM5 repliesview on HN

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.


Replies

hassleblad23last Thursday at 7:09 PM

I think we should welcome all efforts to have a standardized, modern select component in the HTML spec. Would save a lot of trouble.

bmk44last Thursday at 9:42 PM

Even with an average software engineer compensation, you probably got paid a lot more than a penny for every custom "select" you implemented :)

crab_galaxylast Thursday at 6:46 PM

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.

mopsilast Thursday at 10:33 PM

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.

troupoyesterday at 12:38 AM

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

show 1 reply