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
view model =
let
ctx =
KeywordMultiSelector.Context model.searchedSeries model.selectedSeries
KeywordMultiSelector.Context
model.searchString
model.searchedSeries
model.selectedSeries
in
article [ classes [ T.center, T.pt4, T.w_90 ] ]
[ KeywordMultiSelector.view selectorConfig ctx ]
......
......@@ -2,7 +2,7 @@ module KeywordMultiSelector exposing (Config, Context, view)
import Common exposing (classes)
import Html.Styled exposing (..)
import Html.Styled.Attributes exposing (autofocus)
import Html.Styled.Attributes exposing (autofocus, value)
import Html.Styled.Events exposing (onInput)
import ItemSelector
import Tachyons.Classes as T
......@@ -17,7 +17,8 @@ type alias Config msg =
type alias Context =
{ searchedItems : List String
{ searchString : String
, searchedItems : List String
, selectedItems : List String
}
......@@ -26,18 +27,20 @@ view : Config msg -> Context -> Html msg
view cfg ctx =
let
searchInput =
let
inputClass =
classes
[ T.input_reset
, T.ba
, T.b__black_20
, T.pa2
, T.db
, T.w_100
]
in
input [ inputClass, onInput cfg.onInputMsg, autofocus True ] []
input
[ classes
[ T.input_reset
, T.ba
, T.b__black_20
, T.pa2
, T.db
, T.w_100
]
, value ctx.searchString
, onInput cfg.onInputMsg
, autofocus True
]
[]
cols =
let
......
......@@ -10,7 +10,8 @@ type alias Config msg =
type alias Context =
{ searchedItems : List String
{ searchString : String
, searchedItems : List String
, selectedItem : Maybe String
}
......@@ -18,5 +19,5 @@ type alias Context =
view : Config msg -> Context -> Html msg
view cfg ctx =
KeywordMultiSelector.view cfg <|
KeywordMultiSelector.Context ctx.searchedItems <|
KeywordMultiSelector.Context ctx.searchString ctx.searchedItems <|
Common.maybe [] (\x -> [ x ]) ctx.selectedItem
......@@ -165,7 +165,10 @@ view model =
[ a [ cls, onClick ToggleSelection ] [ text "Series selection" ] ]
ctx =
KeywordMultiSelector.Context model.searchedSeries model.selectedSeries
KeywordMultiSelector.Context
model.searchString
model.searchedSeries
model.selectedSeries
in
div [ classes [ T.center, T.pt4, T.w_90 ] ]
(if model.activeSelection then
......
......@@ -295,7 +295,10 @@ view : Model -> Html Msg
view model =
let
ctx =
KeywordSingleSelector.Context model.searchedSeries model.selectedSerie
KeywordSingleSelector.Context
model.searchString
model.searchedSeries
model.selectedSerie
content =
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