# Input.select not available in Elm-UI?

**URL:** <https://discourse.elm-lang.org/t/input-select-not-available-in-elm-ui/2874>\
**Category:** Learn\
**Created:** [January 3, 2019, 9:36pm UTC](https://discourse.elm-lang.org/t/input-select-not-available-in-elm-ui/2874 "2019-01-03T21:36:44Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![paulh](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/paulh/32/5022_2.png) [@paulh](https://discourse.elm-lang.org/u/paulh)\
**Post date:** [January 3, 2019, 9:36pm UTC](https://discourse.elm-lang.org/t/input-select-not-available-in-elm-ui/2874/1 "2019-01-03T21:36:44Z")

</div>

In Style Elements there is Input.select which does not appear to be available in Elm-UI.

How would I go about creating a selectable list of options with Elm-UI?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![stevensonmt](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/stevensonmt/32/889_2.png) [@stevensonmt](https://discourse.elm-lang.org/u/stevensonmt)\
**Post date:** [January 3, 2019, 10:14pm UTC](https://discourse.elm-lang.org/t/input-select-not-available-in-elm-ui/2874/2 "2019-01-03T22:14:10Z")

</div>

Lots of ways to do this, I’m sure. I think they will all boil down to storing the selections in the model and updating the model on click events of the items of interest.  
Very simple example:  
[https://ellie-app.com/4mqfDW4k759a1](https://ellie-app.com/4mqfDW4k759a1)  
You could style the list based on inclusion in the model.selection to alert the user that the selection took place. The super simple example above you have to look at debug to see that it got added.  
A better method would be to make onClick toggle selection so that items can be added and removed.

---

<div class="post-metadata">

**Author:** ![paulh](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/paulh/32/5022_2.png) [@paulh](https://discourse.elm-lang.org/u/paulh)\
**Post date:** [January 3, 2019, 11:56pm UTC](https://discourse.elm-lang.org/t/input-select-not-available-in-elm-ui/2874/3 "2019-01-03T23:56:21Z")

</div>

Thanks, but I was thinking more of a drop down menu (should have elaborated better), that opens and closes when clicked, with the options overlaying existing content below.

It was simple to set up in Style Elements and was surprised to see that it wasn’t included in Elm-UI - I’d be interested to understand why it wasn’t included if anyone has any insights.

If there’s no standard way of creating this I’ll look into rolling my own.

Thanks for taking the time to reply.

---

<div class="post-metadata">

**Author:** ![stevensonmt](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/stevensonmt/32/889_2.png) [@stevensonmt](https://discourse.elm-lang.org/u/stevensonmt)\
**Post date:** [January 4, 2019, 1:16am UTC](https://discourse.elm-lang.org/t/input-select-not-available-in-elm-ui/2874/4 "2019-01-04T01:16:42Z")

</div>

Yeah, there was a fair bit of discussion in the slack channel about dropdowns and such. Rolling your own seems to be the way to go. Sorry I misunderstood your situation initially.

---

<div class="post-metadata">

**Author:** ![passiomatic](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/passiomatic/32/1250_2.png) [@passiomatic](https://discourse.elm-lang.org/u/passiomatic)\
**Post date:** [January 4, 2019, 8:57am UTC](https://discourse.elm-lang.org/t/input-select-not-available-in-elm-ui/2874/5 "2019-01-04T08:57:26Z")

</div>

> [@paulh](#):
>
> It was simple to set up in Style Elements and was surprised to see that it wasn’t included in Elm-UI - I’d be interested to understand why it wasn’t included if anyone has any insights.

The missing `select` in Elm-UI is intentional because, generally speaking, drop downs menus can be misused easily thus creating sub optimal UI’s. A couple of links:

- [Uibook – Joel on Software](https://www.joelonsoftware.com/category/uibook/) (See chapter 7)
- [The Country Picker. How Small Things Makes Big Differences](https://boagworld.com/usability/the-country-picker-how-small-things-makes-big-differences/)

So the author decided to not include the `select` widget. If you have few items you can use a columns of radio buttons, if you have a long list perhaps the user is better  
served with an autocomplete text box - granted a more challenging solution to code.

Hope this helps.

---

<div class="post-metadata">

**Author:** ![paulh](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/paulh/32/5022_2.png) [@paulh](https://discourse.elm-lang.org/u/paulh)\
**Post date:** [January 5, 2019, 10:54am UTC](https://discourse.elm-lang.org/t/input-select-not-available-in-elm-ui/2874/6 "2019-01-05T10:54:35Z")

</div>

That helps a lot, the links were useful and provided some good reading.

For the current project I’ll use a row of buttons for short lists. For longer lists I have some ideas that do actually make more sense from the user perspective than having to scroll a long list of options, especially as I need to allow the user to select the same options multiple times.

I’m glad the select widget was dropped now I understand why.

Thank you.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/elm_lang/original/1X/50a05e53677a2c3b47776d7abd0f113eb50193a1.png) [@system](https://discourse.elm-lang.org/u/system)\
**Post date:** [January 15, 2019, 10:54am UTC](https://discourse.elm-lang.org/t/input-select-not-available-in-elm-ui/2874/7 "2019-01-15T10:54:43Z")

</div>

Closed on January 15, 2019, 10:54am UTC

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.
