Interesting. I've felt some tension around this as well. I've got an app with a 
grid of photos that needs to run layout logic based on the width available. 
Right now, I'm basically deriving that width from the window width but that 
splits my page layout between Elm and CSS as processed by the browser. If I 
were to do anything that depended on text measurement, I couldn't do the layout 
in Elm and would have to get the values back from the DOM. It would be nice to 
have standard Elm virtual DOM attributes for receiving geometry and scroll 
position.

Mark

> On Jun 24, 2016, at 4:52 AM, debois <[email protected]> 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:
> 
> https://medium.com/@debois/elm-the-dom-8c9883190d20#.pbwnl4bgl
> 
> I needed this for elm-mdl. If you have a similar need, you might like the 
> post, and you might find the the elm-dom library useful. The latter provides 
> some ready-made encoders and a substitute for getBoundingClientRect.
> 
> I'd appreciate any comments. 
> 
> Obviously, the functionality of reading geometry off the DOM, including 
> calling getBoundingClientRect, should be provided by Core. It doesn't seem to 
> be on the roadmap for the immediate future, though, so in the meantime, I 
> thought you might find the above useful. 
> 
> Cheers,
> 
> Søren
> -- 
> 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.

-- 
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.

Reply via email to