Skip to content

Bug: When dropping aligned to a grid, it does not drop where it should #453

@fairps

Description

@fairps

I would consider this a bug.

Overview of the problem

The dragGrid is honored when dragging the object, but when it is dropped it "jumps" when ending the drag. You can see it in the example if you release the drag carefully so you don't move when releasing it and you can watch it jump when you let it go. It is now impossible to drag it back on top of the second item that was never moved, because they are now locked to different 50 x 50 grids (in this case).

Reproduced project

The following CodeSandbox demonstrates the issue:
https://codesandbox.io/s/pyyj7l55mx

Description

This is a modified clone of the size/position example. There are two rectangles that start on top of eachother, and each has a dragGrid and resizeGrid of [50, 50].

Steps to Reproduce

  1. There are two squares on top of each other. Drag one of them somewhere
  2. Try and drag it back and lay it on the second one that hasn't been moved - you will notice they are offset
  3. You will also notice a jump any time you drag one and let it drop

Expected behavior

I expected them to drop exactly as a they appeared before release and honoring the dragGrid to keep them on the grid.

Actual behavior

They don't drop where you drop them, and they move off the grid, causing them to have their own grid that is not aligned with other objects using a dragGrid

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions