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

[Masonry] Improve height computation and detect changes in children #29351

Merged
merged 2 commits into from
Oct 28, 2021

Conversation

hbjORbj
Copy link
Member

@hbjORbj hbjORbj commented Oct 28, 2021

Closes #29315

Before this PR:

Solution:

  • Error comes from the use of clientHeight. For example, a 90px-tall item is considered 88px. Switch to using window.getComputedStyle().height as it is more precise.
  • In addition, this PR contains a change so that height/order/margin computation is run in response to changes in not only column and spacing but also children as well
  • Code sandbox: https://codesandbox.io/s/basicmasonry-material-demo-forked-e981i

@hbjORbj hbjORbj added bug 🐛 Something doesn't work component: masonry This is the name of the generic UI component, not the React module! labels Oct 28, 2021
@mui-pr-bot
Copy link

mui-pr-bot commented Oct 28, 2021

Details of bundle changes

Generated by 🚫 dangerJS against 750c4b7

@hbjORbj hbjORbj merged commit 808be08 into mui:master Oct 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: masonry This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Masonry] New flexbox implementation doesn't respect columns prop
3 participants