maxmarcon / live_select

Dynamic (multi)selection field for LiveView
https://hex.pm/packages/live_select
Apache License 2.0
186 stars 35 forks source link

Respect `:selected_option_class` when in `:single` mode #42

Open AHBruns opened 1 year ago

AHBruns commented 1 year ago

Per the docs, the :selected_option_class attr is only available when in :tags mode. However, I believe being able to style the current selection uniquely is valuable even in :single mode.

This is in fact how chrome's built-in select works (notice the check next to female, indicating that is the current selection):

Screenshot 2023-09-29 at 8 49 42 PM

If you're open to this change, I'd be happy to PR it. Just don't want work to go to waste.

maxmarcon commented 1 year ago

Hi @AHBruns and thanks for pointing this out. I agree with your observation, and I'd welcome a PR for this change!

Just be aware that I'll be traveling for the next couple of weeks with little time to spend for coding. So it might take a while before I can review your PR, but I'll do it as soon as I find some time!

Thanks

AHBruns commented 1 year ago

I'm up against a tight deadline at work this week, but I will have time next week. Planning to PR this then assuming it's fairly straightforward.