On Thursday, December 1, 2016 at 11:20:12 AM UTC, Rupert Smith wrote:
>
> I am using Html.Events.on to pick up changes to a property of a Polymer
> component:
>
> listbox
> [ items <| Dict.map (\id -> \(Model.Role role) -> Utils.valOrEmpty
> role.name) model.roleLookup
> , initiallySelected <| Dict.map (\id -> \(Model.Role role) ->
> Utils.valOrEmpty role.name) model.selectedRoles
> , onSelectedChanged SelectChanged
> ]
>
> With:
>
> onSelectedChanged : (Dict String String -> msg) -> Attribute msg
> onSelectedChanged tagger =
> onItemArrayChanged "selected-changed" tagger
>
> onItemArrayChanged : String -> (Dict String String -> msg) -> Attribute msg
> onItemArrayChanged propname tagger =
> on propname <| Decode.map tagger <| Decode.map Dict.fromList
> decodeItems
>
> In other words I am using
>
> on "selected-changed" to trigger notification that the listbox selection
> has changed.
>
> I've added enough debug statements to figure out that everything is
> working as it did on 0.17, but that this 'on' Attribute is failing to
> receive any events in 0.18.
>
> Any thoughts on how to debug further? Anyone else noticed 'on' not working
> as expected?
>
>
>
I was able to attach the debugger at the right point to see what is going
on in eventHandler.
Seems that for some reason where I was previously decoding a List encoded
Dict as json as the value associated with the event, a String is now
expected.
value = Object {ctor: "Err", _0: "Expecting a String at _.detail.value[0]
but instead got: ["1","auth-root"]"}
But at least that gives me some clues as to where to look to fix it.
--
You received this message because you are subscribed to the Google Groups "Elm
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.