Skip to content

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

Merged
hbjORbj merged 2 commits into
mui:masterfrom
hbjORbj:masonry-fix
Oct 28, 2021
Merged

hbjORbj merged 2 commits into
mui:masterfrom
hbjORbj:masonry-fix

Conversation

@hbjORbj

@hbjORbj hbjORbj commented Oct 28, 2021 •

Copy link
Copy Markdown
Contributor

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 type: bug It doesn't behave as expected. scope: masonry Changes related to the masonry. labels Oct 28, 2021
@mui-pr-bot

mui-pr-bot commented Oct 28, 2021 •

Copy link
Copy Markdown

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

scope: masonry Changes related to the masonry. type: bug It doesn't behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

3 participants