Skip to content

Horizontal swapping occurs while dragging external widgets into the grid #3304

Description

@Pathmanaban-t

GridStack v12: Horizontal swapping occurs while dragging external widgets into the grid

Description

I'm currently upgrading my application from GridStack v3 to GridStack v12 and noticed a change in swapping behavior during drag-and-drop operations.

In GridStack v12, horizontal swapping occurs while dragging a new widget from an external panel into the grid. In GridStack v3, this behavior did not occur—the existing widgets remained in place until the new widget was dropped.

My requirement is to allow swapping only between widgets that are already placed inside the grid, and not while dragging new widgets from an external panel.

Expected Behavior

  • Existing grid-stack-items should be allowed to swap with each other while being dragged within the grid.
  • Widgets dragged from an external panel should not trigger horizontal swapping until they are dropped into the grid.

Actual Behavior

  • While dragging a new widget from an external panel into the grid, existing widgets immediately begin swapping horizontally before the widget is dropped.

Steps to Reproduce

  1. Create a GridStack v12 grid with multiple existing widgets.
  2. Enable dragging of new widgets from an external panel (dragIn).
  3. Drag a new widget into the grid.
  4. Observe that existing widgets start swapping horizontally during the drag operation.

Environment

  • GridStack version: v12.x
  • Previous version: v3.x
  • Browser: (please fill in)
  • OS: (please fill in)

Question

Is there any configuration or recommended approach in GridStack v12 to:

  • Disable swapping while dragging external widgets into the grid.
  • Allow swapping only for widgets that are already part of the grid.

Additional Context

I've attached a short video demonstrating the behavior for reference.

Using.gridstack.version.3.1.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions