Commit 169e674b authored by André Espaze's avatar André Espaze
Browse files

Fix absent value on input rendering

parent 9fad7d70c557
...@@ -165,7 +165,10 @@ view : Model -> Html Msg ...@@ -165,7 +165,10 @@ view : Model -> Html Msg
view model = view model =
let let
ctx = ctx =
KeywordMultiSelector.Context model.searchedSeries model.selectedSeries KeywordMultiSelector.Context
model.searchString
model.searchedSeries
model.selectedSeries
in in
article [ classes [ T.center, T.pt4, T.w_90 ] ] article [ classes [ T.center, T.pt4, T.w_90 ] ]
[ KeywordMultiSelector.view selectorConfig ctx ] [ KeywordMultiSelector.view selectorConfig ctx ]
......
...@@ -2,7 +2,7 @@ module KeywordMultiSelector exposing (Config, Context, view) ...@@ -2,7 +2,7 @@ module KeywordMultiSelector exposing (Config, Context, view)
import Common exposing (classes) import Common exposing (classes)
import Html.Styled exposing (..) import Html.Styled exposing (..)
import Html.Styled.Attributes exposing (autofocus) import Html.Styled.Attributes exposing (autofocus, value)
import Html.Styled.Events exposing (onInput) import Html.Styled.Events exposing (onInput)
import ItemSelector import ItemSelector
import Tachyons.Classes as T import Tachyons.Classes as T
...@@ -17,7 +17,8 @@ type alias Config msg = ...@@ -17,7 +17,8 @@ type alias Config msg =
type alias Context = type alias Context =
{ searchedItems : List String { searchString : String
, searchedItems : List String
, selectedItems : List String , selectedItems : List String
} }
...@@ -26,18 +27,20 @@ view : Config msg -> Context -> Html msg ...@@ -26,18 +27,20 @@ view : Config msg -> Context -> Html msg
view cfg ctx = view cfg ctx =
let let
searchInput = searchInput =
let input
inputClass = [ classes
classes [ T.input_reset
[ T.input_reset , T.ba
, T.ba , T.b__black_20
, T.b__black_20 , T.pa2
, T.pa2 , T.db
, T.db , T.w_100
, T.w_100 ]
] , value ctx.searchString
in , onInput cfg.onInputMsg
input [ inputClass, onInput cfg.onInputMsg, autofocus True ] [] , autofocus True
]
[]
cols = cols =
let let
......
...@@ -10,7 +10,8 @@ type alias Config msg = ...@@ -10,7 +10,8 @@ type alias Config msg =
type alias Context = type alias Context =
{ searchedItems : List String { searchString : String
, searchedItems : List String
, selectedItem : Maybe String , selectedItem : Maybe String
} }
...@@ -18,5 +19,5 @@ type alias Context = ...@@ -18,5 +19,5 @@ type alias Context =
view : Config msg -> Context -> Html msg view : Config msg -> Context -> Html msg
view cfg ctx = view cfg ctx =
KeywordMultiSelector.view cfg <| KeywordMultiSelector.view cfg <|
KeywordMultiSelector.Context ctx.searchedItems <| KeywordMultiSelector.Context ctx.searchString ctx.searchedItems <|
Common.maybe [] (\x -> [ x ]) ctx.selectedItem Common.maybe [] (\x -> [ x ]) ctx.selectedItem
...@@ -165,7 +165,10 @@ view model = ...@@ -165,7 +165,10 @@ view model =
[ a [ cls, onClick ToggleSelection ] [ text "Series selection" ] ] [ a [ cls, onClick ToggleSelection ] [ text "Series selection" ] ]
ctx = ctx =
KeywordMultiSelector.Context model.searchedSeries model.selectedSeries KeywordMultiSelector.Context
model.searchString
model.searchedSeries
model.selectedSeries
in in
div [ classes [ T.center, T.pt4, T.w_90 ] ] div [ classes [ T.center, T.pt4, T.w_90 ] ]
(if model.activeSelection then (if model.activeSelection then
......
...@@ -295,7 +295,10 @@ view : Model -> Html Msg ...@@ -295,7 +295,10 @@ view : Model -> Html Msg
view model = view model =
let let
ctx = ctx =
KeywordSingleSelector.Context model.searchedSeries model.selectedSerie KeywordSingleSelector.Context
model.searchString
model.searchedSeries
model.selectedSerie
content = content =
case model.state of case model.state of
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment