[elm-discuss] Re: Html.Attributes.none

2017-08-18 Thread Lars Jacobsson
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

[elm-discuss] Re: Html.Attributes.none

2017-01-26 Thread 'Rupert Smith' via Elm Discuss
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,

[elm-discuss] Re: Html.Attributes.none

2017-01-25 Thread Robert Lee
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

[elm-discuss] Re: Html.Attributes.none

2017-01-25 Thread 'Rupert Smith' via Elm Discuss
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

[elm-discuss] Re: Html.Attributes.none

2017-01-24 Thread Bernardo
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

Re: [elm-discuss] Re: Html.Attributes.none

2017-01-24 Thread Eric G
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

Re: [elm-discuss] Re: Html.Attributes.none

2017-01-24 Thread Mark Hamburg
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 >

[elm-discuss] Re: Html.Attributes.none

2017-01-24 Thread OvermindDL1
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