[elm-discuss] Re: How to focus a particular element i just rendered?

2016-06-24 Thread Mark Skipper
I guess I should be looking here https://groups.google.com/forum/#!searchin/elm-discuss/focu/elm-discuss/b90rqhnfjXw/-eJtlXIJAQAJ -- 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,

[elm-discuss] How to focus a particular element i just rendered?

2016-06-24 Thread Mark Skipper
Im rewriting some JS in Elm. When the user clicks on an element the JS replaces the element with an with the same contents, and calls .focus() In Elm I'm keeping the editing state in a boolean and view draws the component as when were editing, and the display element when we're not. But I

Re: [elm-discuss] Re: Impressions from a new user

2016-06-24 Thread barmin
You could define emptyLine somewhere in your code and just do Maybe.withDefault emptyLine (Dict.get name model.lines) Oh yes, that's great! Adopted! Thanks for the others pointers. I obviously still have quite a lot to discover in the language and its ecosystem! (although I was already aware

Re: [elm-discuss] Re: virtual-dom hooks

2016-06-24 Thread San Gillis
Like Joe mentioned, the virtual-dom implementation changed completely in 0.17. I have not had time yet to look into porting this library to 0.17 or look into the new virtual-dom, so unfortunately I can't help you at this time. But if what Joe says is right (there is no mechanism for creation

Re: [elm-discuss] Re: virtual-dom hooks

2016-06-24 Thread Joe Andaverde
The rewrite of virtual-dom in 0.17 does not provide any mechanism for knowing when a dom element is created, re-rendered, or removed. Which would be essential for initializing a third party control. Even in the version used in 0.16 I'm not sure the entire life-cycle for a dom node was

Re: [elm-discuss] Re: Impressions from a new user

2016-06-24 Thread barmin
Hi Matt, Thanks for your nice answer! As for Dicts, I would say double check to make sure you don't actually want a record. Basically if you know all the fields at compile time...you probably want a record, not a dict. I may have an habit of using dicts too often... (in python, almost

Re: [elm-discuss] http request: How to access the whole response

2016-06-24 Thread germain
Hi William, > The error type has to be "Maybe" because we could hit a network error > before we get a response > Yes,the Task.andThen error returned value could be with or without response! The compiler forces us to take into consideration both scenarios => the error returned value (what

[elm-discuss] Re: DOM geometry and getBoundingClientRect

2016-06-24 Thread Robert Walter
Interesting work, thanks! On Friday, June 24, 2016 at 10:52:14 AM UTC+2, debois wrote: > > Dear all, > > I just published a blog post on how to get geometry of rendered > elements—in particular calling getBoundingClientRect—by constructing JSON > decoders for use with Html.Events.on: > >

[elm-discuss] DOM geometry and getBoundingClientRect

2016-06-24 Thread debois
Dear all, I just published a blog post on how to get geometry of rendered elements—in particular calling getBoundingClientRect—by constructing JSON decoders for use with Html.Events.on: https://medium.com/@debois/elm-the-dom-8c9883190d20#.pbwnl4bgl I needed this for elm-md