How to signal a polymer element when offsetWidth / offsetHeight is ready?

133 views
Skip to first unread message

Steven Bennetts

unread,
Jun 16, 2016, 9:05:56 PM6/16/16
to polym...@googlegroups.com
I have a polymer element that needs to layout some children based on its size.

If I attempt to do this in attached(), the offsetWidth/Height of the element is 0 (the page still has not been rendered).

Is there any way for the element to be notified when offsetWidth/Height is guaranteed to be valid?

Eric Bidelman

unread,
Jun 16, 2016, 10:08:31 PM6/16/16
to Steven Bennetts, polym...@googlegroups.com
Make sure you're making the element block level `:host {display: block}`. This works for me: http://jsbin.com/qusopuzuze/edit?html,output


Follow Polymer on Google+: plus.google.com/107187849809354688692
---
You received this message because you are subscribed to the Google Groups "Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to polymer-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/CADko7PHt5m%2BJ509bpy3hdit%2BLeX2c58cf-ibciW%3DHptg9j8jKA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages