Post

Is there really no good standalone (no framework used/bundled) combobox web component????

2 reposts27 likes

If you decide to use a framework, there's this one in Preact I saw recently. Not sure if you've heard of Preact, it's awesome if you haven't heard of it. bsky.app/profile/muna...

Munawwar Firoz@munawwar.bsky.social

Announcing Preact Combobox - Multi-select & Single-select modes - Partial word matching, accent matching - Lazy options loading and remote search support - Light / Dark theme, RTL, Translation, form submit support www.npmjs.com/package/prea...

I was trying to package it as a web component using preact-custom-element, but I don't know how I will support render function props <component ... optionsRender={(label, value) => funkyJSX} />

material (mwc) has one iirc but the project seems to have lost to politics somewhere along the way and isn't as maintained now would also love to see one. im surprised shoelace hasn't got one

^ this one is currently DOM based, so it doesnt even really handle async data fetching / transforms either, which also means by relying on DOM elements, virtualization isn't _really_ supported. One of these days im gonna find the time to make it "right" for shoelace / web awesome...

How long ago? I wrote one with aria-activedescendant and tested it (just recently) across all screen readers and browsers and platforms and it seemed to work fine in Safari.

GitHub says about 1year ago is when I wrote it. Based on some light WebKit bug browsing....it was supposedly fixed around v18-ish on Safari? Definitely some recent bug fixes around it about ~8months or so ago.

and what about when someone asks for multi-select? 😅 in many cases in the past i've ended up using a tags input, basically. like a combo but populate a tags list

I think no. It kinda falls into the same area as custom select. But there might be some other pattern like før example a checkbox list that could do the job depending on what you are trying to do. You could of course use <select> but calling it good would be over stating it.