rob-balfre / svelte-select

Svelte Select. A select component for Svelte
https://svelte-select-examples.vercel.app
Other
1.26k stars 175 forks source link

[v5] Expand list to fit contents (wider than input) #488

Closed madeleineostoja closed 1 year ago

madeleineostoja commented 1 year ago

I have a bit of a niche use-case and I can't figure out how to address it with v5. The items in my list have extra content compared to the rendered selected item, and I want the list to be wider than the select's input.

Ie, not clip this content:

Screen Shot 2022-10-25 at 12 08 12 PM

I can't find the right combination of CSS vars or floating-ui config to achieve that, do you have any pointers? Is it even possible?

rob-balfre commented 1 year ago

@madeleineostoja how about this https://svelte.dev/repl/3e45fab6855e44b59e5fa58a06bf495c?version=3.52.0 ?

madeleineostoja commented 1 year ago

ah heck I totally missed that option, sorry! Yep works perfecly.

EDIT — FWIW I feel like that should be the default behavior, since that's how native select inputs work