Skip to content

At what stage in the lifecycles should it be safe to call .clientWidth of a rendered element in my template #4578

Answered by tkmoney
tkmoney asked this question in Q&A
Discussion options

You must be logged in to vote

aw ok, I figured it out,

I was attempting to get .clientWidth while the components parent has display:none; set. This causes any reading of .clientWidth or any other size data from child elements to return 0. Thank you for sending me down the correct path!

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@tkmoney
Comment options

Answer selected by tkmoney
@sorvell
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants