newly added item in small breakpoint layout shrinks in the bigger breakpoint layout · Issue #2110 · react-grid-layout/react-grid-layout · GitHub
More Web Proxy on the site http://driver.im/
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a responsive dashboard, which allows users to add/remove widgets as well. I am saving the layouts in db.
When md breakpoint is active, I add a new item ( by just pushing a div with key and data-grid prop on it ), the onLayoutChange gets triggered I save the values of the second arg in db ( i.e. all layouts keyed by breakpoints )
However, when I start to increase the screen size, the newly added item shrinks because for bigger breakpoint the layout is not defined.
If we try the opposite, i.e. add a new item in the xl mode and then reduce the screen size everything works fine.
Describe the bug
I have a responsive dashboard, which allows users to add/remove widgets as well. I am saving the layouts in db.
When md breakpoint is active, I add a new item ( by just pushing a div with key and data-grid prop on it ), the onLayoutChange gets triggered I save the values of the second arg in db ( i.e. all layouts keyed by breakpoints )
However, when I start to increase the screen size, the newly added item shrinks because for bigger breakpoint the layout is not defined.
If we try the opposite, i.e. add a new item in the xl mode and then reduce the screen size everything works fine.
Your Example Website or App
https://codesandbox.io/p/sandbox/g6npg3
Steps to Reproduce the Bug or Issue
the example attached do not add/remove items but simulates the same problem. the layout for "2" is defined in md so it breaks in the lg.
Expected behavior
it should either remain the same size or increase but definitely not shrink.
react-grid-layout library version
1.5.0
Operating System Version
macOS 14.4
Browser
Chrome
Additional context
No response
Screenshots or Videos
RGL.tsx.nodebox.CodeSandbox.-.2.January.2025.mp4
The text was updated successfully, but these errors were encountered: