PaackEng / elm-ui-dropdown

Dropdown module for Elm UI
https://package.elm-lang.org/packages/PaackEng/elm-ui-dropdown/latest/
MIT License
20 stars 11 forks source link

[Feature Request] Ability to set default selected option #30

Closed peteygao closed 3 years ago

peteygao commented 3 years ago

Right now the selection always defaults to nothing. I would like to be able to set an initial state when I'm fetching data from the backend and are displaying it on the front-end.

Right now I'm "hacking" around this by changing the default prompt with the pre-set value, but this feels a bit weird PLUS the open dropdown will not have the "selected" option highlighted with the chosen highlight colour.

Is this a first class feature you folks are willing to add to the package?

jouderianjr commented 3 years ago

Hey @peteygao, we will have this in the next release, sadly, this version will have an API change, so it will require some change in the code :'(. We added are able to have this feature after #24 and I just did a proposal for a small change in #31, once we close or merge this pr we will release a new version. Let us know if those changes are good enough for your needs.

peteygao commented 3 years ago

Just looked at those two PR's, the changes LGTM 👍🏼!

jouderianjr commented 3 years ago

This was fixed on 3.0.0