Calculating block properties once rendered #1771
Unanswered
Axelcureno
asked this question in
Q&A
Replies: 1 comment
-
At the moment I don't think it's possible since the block code runs before the blocks are rendered. I think that we could change Definitely would need to be heavily tested and make sure that performance isn't affected. @auniverseaway @rgclayton Thoughts? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there a way in Milo to calculate properties of a given block (e.g width/height) once after the block is rendered?
I've noticed using events like
window.onload
ordocument.addEventListener('DOMContentLoaded', function() {
, or evenupdated()
orfirstupdated()
when using web components, don't seem to trigger at all and when getting something likeoffsetHeight
and the value of everything is zero. I'm guessing this might be due how Milo loading lifecycle is set.In the case of my requirement, I need to calculate the biggest height of a portion of the block and then resize all the blocks to the maximum calculated height value:
Expected:
Actual:
Any ideas or suggestions are greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions