-
I have tried firstUpdated and awaited updateComplete as well as the "updated" method and each time I get returned "0" when I call .clientWidth on the element. I also tried getBoundingClientRect (returns 0 for everything) as well as offsetWidth. If I do an initial render but then later make a change to the component, then I DO see correct values for .clientWidth within the updated method. I also tried wrapping it in a requestAnimationFrame callback but still no luck. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
Beta Was this translation helpful? Give feedback.
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!