gestalt icon indicating copy to clipboard operation
gestalt copied to clipboard

Masonry: Bug fix, enable layout not returning positions of all items

Open manvoid opened this issue 9 months ago • 1 comments

Summary

We found a bug after enabling multiple multi column items on masonry here https://github.com/pinterest/gestalt/pull/3537, this was because masonry expects that the layout functions return all the positions in one run, but for multiple multi column items we do not calculate the position of the items after the second multi column item. This broke masonry although strangely enough the bug was not consistent, that's why it was not immediately obvious. The bug was different on V1 and on V2.

On V1 there was an exception because it tried to render something without a position, to fix it we filter the items with positions before render.

On V2 the layout function was not triggered again after positioning the first multi column item because there was no a condition for that. To fix it we added the multi column items count as dependency.

manvoid avatar Apr 29 '24 03:04 manvoid

Deploy Preview for gestalt ready!

Built without sensitive environment variables

Name Link
Latest commit 314c0dea318beb91ccf23707e5d86a2a288163fb
Latest deploy log https://app.netlify.com/sites/gestalt/deploys/662f133a2ee83a0009b557d5
Deploy Preview https://deploy-preview-3541--gestalt.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar Apr 29 '24 03:04 netlify[bot]

We did a refactor of the feature so this PR is no longer required

manvoid avatar May 13 '24 15:05 manvoid