Skip to content
This repository has been archived by the owner on Apr 11, 2023. It is now read-only.

Commit

Permalink
LMO-887 | Add withEmptyListElement (#52)
Browse files Browse the repository at this point in the history
- Adds `withEmptyListElement`, which shows a replacement for the list when this one is empty;
- Update `Example4`:
- Enhance documentation format;
- Sort config fields alphabetically.
  • Loading branch information
PedroHLC authored Sep 10, 2021
1 parent b266a62 commit 3df67ba
Show file tree
Hide file tree
Showing 3 changed files with 162 additions and 111 deletions.
2 changes: 1 addition & 1 deletion elm.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "PaackEng/elm-ui-dropdown",
"summary": "An Elm UI dropdown component",
"license": "MIT",
"version": "3.2.0",
"version": "3.3.0",
"exposed-modules": [
"Dropdown"
],
Expand Down
11 changes: 11 additions & 0 deletions examples/Example4.elm
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,16 @@ dropdownConfig =
[ el [] (text "-")
, el [ Font.size 16 ] (text i)
]

emptyListElement =
Element.el
[ Element.width fill
, Font.size 12
, Element.padding 8
, Background.color <| rgb255 255 220 220
]
<|
Element.text "Nothing matches..."
in
Dropdown.filterable
{ itemsFromModel = always options
Expand All @@ -151,6 +161,7 @@ dropdownConfig =
, itemToElement = itemToElement
, itemToText = identity
}
|> Dropdown.withEmptyListElement emptyListElement
|> Dropdown.withContainerAttributes containerAttrs
|> Dropdown.withSelectAttributes selectAttrs
|> Dropdown.withListAttributes listAttrs
Expand Down
Loading

0 comments on commit 3df67ba

Please sign in to comment.