Skip to content

Commit

Permalink
remove isComplete. can be determined by consumer
Browse files Browse the repository at this point in the history
  • Loading branch information
gregziegan committed May 17, 2016
1 parent 6bf6cc8 commit 08dcfaa
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/Autocomplete.elm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Autocomplete exposing (Autocomplete, Status, init, initWithConfig, Msg, update, view, getSelectedItem, getCurrentValue, showMenu, setValue, isComplete, setItems, setLoading, MenuNavigation(Previous, Next, Select), navigateMenu, defaultStatus)
module Autocomplete exposing (Autocomplete, Status, init, initWithConfig, Msg, update, view, getSelectedItem, getCurrentValue, showMenu, setValue, setItems, setLoading, MenuNavigation(Previous, Next, Select), navigateMenu, defaultStatus)

{-| A customizable Autocomplete component.
Expand Down Expand Up @@ -45,7 +45,15 @@ main =
@docs getSelectedItem, getCurrentValue
# Controlling Behavior
@docs showMenu, setValue, isComplete, setItems, setLoading, MenuNavigation, navigateMenu
If you want the autocomplete to be completely controlled, with no `input` field, use the Config
module's `isValueControlled` function to designate that the API consumer will control the autocomplete.
This is useful for mentions and other autocomplete examples inside textareas, contenteditable, etc.
Defined below are functions to control:
the autocomplete's menu navigation, set its value, items, and whether its menu should be shown.
@docs showMenu, setValue, setItems, setLoading, MenuNavigation, navigateMenu
# Defaults
@docs defaultStatus
Expand Down Expand Up @@ -339,13 +347,6 @@ setValue value auto =
fst (updateAutocomplete (SetValue value) auto)


{-| Returns true if Autocomplete matches an item exactly
-}
isComplete : Autocomplete -> Bool
isComplete (Autocomplete model) =
List.member model.value model.items


{-| Sets the Autocomplete's list of items -}
setItems : List String -> Autocomplete -> Autocomplete
setItems items auto =
Expand Down

0 comments on commit 08dcfaa

Please sign in to comment.