gdotdesign / elm-ui

UI library for making web applications with Elm
https://elm-ui.netlify.com
BSD 2-Clause "Simplified" License
920 stars 39 forks source link

Chooser custom text for "No items to display!" #71

Closed michie1 closed 7 years ago

michie1 commented 7 years ago

As a programmer that's using the elm-ui chooser, I would like to set the text for when there are no items to display or to select. no items In above picture I would like to set the text to "No movies to select."

I would be nice if it was possible to change this text the same way as the placeholder text can be changed.

The value of the string is now hard coded in Styles/Chooser.elm on line 115.

Before trying to create a pull request for this I would like to known if someone is already busy with this feature, are there any tips how to implement this and if this feature is a good idea in general.

gdotdesign commented 7 years ago

Hey, thanks for bringing up this issue:

michie1 commented 7 years ago

I've got a first commit, but I think it's too soon for a pull request. https://github.com/michie1/elm-ui/commit/3807426ab14b97e14953e6affe1547a4f53ab241`

gdotdesign commented 7 years ago

Why do you want emptyContent to be Html.Html msg and not String?

I'm passing now the value from emptyContent to the style/theme, but I prefer to put the html of this part in the view and not in the style, somehow. Similar to placeholder, it's value is also not needed in the theme.

I agree with this and it's in sync with the first point above. The best place to do that would be here: https://github.com/gdotdesign/elm-ui/blob/development/source/Ui/Chooser.elm#L309 with a node "ui-chooser-empty-content"

gdotdesign commented 7 years ago

PR https://github.com/gdotdesign/elm-ui/pull/73