Skip to content

Unable to swap 2 items when float is true #1990

@harrington101

Description

@harrington101

Subject of the issue

I have a grid that allows floating. I would like to move the top item below the one directly below it. When I drag it downward, the item below it moves down also. Instead, it should swap positions so that the one on the bottom becomes the one on top. If I leave float set to false then it tries to fill in all the spaces when one of the items is 2 rows tall rather than leaving those spaces empty.

Your environment

Gridstack 3.1.0
Google Chrome Latest

Steps to reproduce

Go to this URL:
https://jsfiddle.net/qk5zuwyd/
Try dragging 0 down below 1. Notice that 1 runs away to the south instead of swapping with 0.

Significant changes to template: set float to true.

Expected behavior

0 and 1 should swap places. Regardless of the x, y position if the two being swapped are the same size they should just swap places.

Actual behavior

1 runs away from 0 when dragging 0 down.

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