Skip to content

Grid height disappears when quickly moving the only grid-stack-item — likely due to dropout removing the node incorrectly. #3178

@cosmic-gao

Description

@cosmic-gao

Subject of the issue

Grid height disappears when quickly moving the only grid-stack-item — likely due to dropout removing the node incorrectly.

environment

gridstack.js version: 12.3.3

Node: 24.10.0

pnpm: 10.20.0

OS: Windows

Steps to reproduce

Create a GridStack layout with only one grid-stack-item.

Quickly drag and move that item within the same grid area.

Observe that sometimes the grid’s height collapses (disappears).

After investigation, it appears that the issue occurs because when the node is temporarily removed, grid.getRow() becomes 0.
This seems to be triggered by the dropout event logic — it removes the node when detecting that node.grid and the current grid instance are the same.

Expected behavior

I think this behavior might not be correct.
The node should only be removed if its gridstack instance is different from the current dragging grid.
If both are the same instance, the node should remain in the grid and not be removed during dropout.

Image Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions