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

item width breaks with text wrap #172

Open
proohit opened this issue Nov 22, 2024 · 4 comments
Open

item width breaks with text wrap #172

proohit opened this issue Nov 22, 2024 · 4 comments
Labels
question Further information is requested

Comments

@proohit
Copy link

proohit commented Nov 22, 2024

Describe the bug
It appears the width calculation of each item breaks if the layout gives the masonry smaller available space, and gives it back afterwards. I've detected this with animations using framer-motion, see sandbox below. The masonry container appears to get the correct width. Also, triggering a rerender seems to fix the issue, but i don't know when to rerender in order to fix that.

To Reproduce
Hover over the nav bar, in order for it to grow. Then hover away and the masonry stays in the shrunk state
https://codesandbox.io/p/sandbox/frosty-framework-kfksfg

Expected behavior
The layout should adapt to wrapped/unwrapped text and calculate the width accordingly.

Screenshots

Before:
image
After:
image

@jaredLunde
Copy link
Owner

@jaredLunde jaredLunde added the question Further information is requested label Nov 22, 2024
@proohit
Copy link
Author

proohit commented Nov 22, 2024

Thanks for your quick response. Unfortunately, I do not quite get what the proposed solutions are. I thought that the Masonry components use the remaining width automatically, as the masonry container width is set to "100%".

@jaredLunde
Copy link
Owner

The default component only updates if the size of the window changes

1 similar comment
@jaredLunde
Copy link
Owner

The default component only updates if the size of the window changes

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

No branches or pull requests

2 participants