Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/SemanticUI/Modules/Dropdown/Select.elm
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ type Variation msg
| Button (Button.Config msg)
| Inline
| Selection { compact : Bool }
| MenuItem


variationClassList : Variation msg -> List ( String, Bool )
Expand All @@ -74,6 +75,9 @@ variationClassList variation =
Selection { compact } ->
[ ( "compact", compact ), ( "selection", True ) ]

MenuItem ->
[ ( "inline", True ), ( "item", True ) ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see inline in the semantic ui examples for this - possible it's specific to the menu you're building?



{-| Most general configuration that applies any `Select`.

Expand Down
24 changes: 24 additions & 0 deletions src/SemanticUI/Modules/Dropdown/Selection.elm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module SemanticUI.Modules.Dropdown.Selection exposing
, inline
, label
, linkItem
, menuItem
, scrolling
, selection
, single
Expand Down Expand Up @@ -345,6 +346,29 @@ inline config =
, caret = True
}

{-| A single selection dropdown component that can be used as a menu item.
-}
menuItem :
{ config
| value : selection
, drawerState : Drawer.State
, identifier : String
, onToggle : Drawer.State -> msg
, onSelect : option -> msg
, isSelected : option -> Bool
}
-> Selection msg option selection
menuItem config =
let
(Selection singleConfig) =
single config
in
Selection
{ singleConfig
| variation = Select.MenuItem
, caret = True
}


toHtml : { builder | optionLabel : option -> Html msg, options : List option } -> Selection msg option selection -> Html msg
toHtml { optionLabel, options } selectionControl =
Expand Down