8000 Layout Breaks When Loading in Smaller Breakpoints · Issue #2947 · gridstack/gridstack.js · GitHub
[go: up one dir, main page]

Skip to content
Layout Breaks When Loading in Smaller Breakpoints #2947
Closed
@GowthamTG

Description

@GowthamTG

Description

When initializing the GridStack layout in a larger breakpoint (e.g., lg), the grid properly relayouts itself when resizing to a smaller breakpoint like md. However, if the user loads the page directly in a smaller breakpoint (md), the layout appears broken, with widgets not positioned as expected.

Steps to Reproduce

  1. Open the grid layout in a large breakpoint (lg).
  2. Resize the window to a medium breakpoint (md) – layout adjusts correctly.
  3. Refresh the page while in the md breakpoint – layout appears broken.

Expected Behavior

The grid should correctly initialize in smaller breakpoints without requiring a resize from a larger breakpoint.

Screenshots / Video

Example video showcasing the issue:

Screen.Recording.Feb.15.2025.mov

Reproduction Code

CodeSandbox for reference:
https://codesandbox.io/p/sandbox/gridstack-breakpoint-test-twzq7j

Additional Context

  • This issue occurs when the page is initially loaded in a smaller breakpoint like in a ipad or smaller screensize
  • GridStack correctly handles resizing but does not seem to initialize properly in smaller breakpoints.

Would love to hear your thoughts on this! Thanks for the great work on GridStack! 🚀

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0