I'd back this too.
On Tuesday, January 24, 2017 at 11:21:31 PM UTC+1, Robert Lee wrote:
>
> Would anyone else find --Html.Attributes.none-- useful?
>
> none : Html.Attribute a
>
> Use cases look like the following.
>
>
>
> view: Model -> Html.Html Msg
> let
> onClickButton
On Thursday, January 26, 2017 at 3:45:24 AM UTC, Robert Lee wrote:
>
> The following fits in good enough for me.
>
> filterDiv : List (Maybe (H.Attribute msg)) -> List (Maybe (H.Html msg)) ->
> H.Html msg
> filterDiv a n =
> H.div (List.filterMap identity a) (List.filterMap identity n)
>
Yes,
The following fits in good enough for me.
...
filterDiv : List (Maybe (H.Attribute msg)) -> List (Maybe (H.Html msg)) ->
H.Html msg
filterDiv a n =
H.div (List.filterMap identity a) (List.filterMap identity n)
...
measurements : Maybe (Int, Int)
...
isNotClicked: Bool
...
let
style
On Tuesday, January 24, 2017 at 10:21:31 PM UTC, Robert Lee wrote:
>
> Would anyone else find --Html.Attributes.none-- useful?
>
+1 Yes.
Also elm-mdl has a 'when' function which is very useful, and a version of
it for Html.Attribute would be very handy:
Button.disabled |> when (not model.isRu
Could also be something like:
attrs a = List.filterMap identity a
...
let
title = if condition then Just (title "some title") else Nothing
onClick = Nothing
in
div (attrs [title, onClick]) [text "hello"]
On Tuesday, 24 January 2017 19:21:31
Yes. In the past I've used `property "" Json.Encode.null` for this, which
seemed to avoid setting a dummy attribute, but I have no idea how
accidental that is and if it works for browsers other than Chrome.
On Tuesday, January 24, 2017 at 10:41:02 PM UTC-5, Mark Hamburg wrote:
>
> Agreed. I wa
Agreed. I wanted this just the other day as well. For similar reasons, it would
also be nice to have an “official” Html.none rather than just using Html.text
“”.
Mark
On Jan 24, 2017, 3:51 PM -0800, OvermindDL1 , wrote:
> Yes, for precisely the same usage. It is much easier to swap between
>
Yes, for precisely the same usage. It is much easier to swap between
something and `none` then it it to do list building with if conditions. I
made my own by using a dummy attribute name that should 'never be used'
(*cough*) of "nonenonenone".
A side effect is the vdom checking is a little mo