Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dimensions): use getBoundingClientRect() instead of clientHeight #59

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sebelga
Copy link

@sebelga sebelga commented Apr 11, 2019

This PR solves a small layout bug when instantiating the bricks.

If the bricks have a dom height with decimal value (e.g. 512.35), element.clientHeight returns a rounded value for the element height and does not render the layout correctly when looking for the target column (columnTarget).

So if we have 5 bricks all with an height of 512.35px, and a lyout with 4 columns, the columnHeights might look like [512, 513, 512, 513, 512] and the 5th element would be aligned at the 4th column instead of the 1st one.

…ight

element.clientHeight returns a rounded value for the element height and does not render the layout correctly when looking for the target column (columnTarget).
@sebelga
Copy link
Author

sebelga commented Apr 26, 2019

Hi @callmecavs
Any thought in this PR? Tiny change for a huge impact 😊
Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant