Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dragging is bugged when having a custom margin and rowHeight #1997

Open
peteranderss0n opened this issue Dec 6, 2023 · 1 comment
Open

Comments

@peteranderss0n
Copy link

peteranderss0n commented Dec 6, 2023

Describe the bug

Whenever you drag a box with a custom margin and rowHeight the drag functionality becomes invalid.
Please check codesandbox for example, you will see that as soon as you start dragging an item around, it feel awkward compared to other versions.

If I increase the rowHeight it works better, but I'm currently using rowHeight={1}

Your Example Website or App

https://codesandbox.io/p/devbox/yh3s4h?file=%2Fsrc%2FApp.js%3A14%2C19

Steps to Reproduce the Bug or Issue

  1. Navigate to the codesandbox and start the environment
  2. Start drag number 6 box a few pixels, as soon as you start moving it, it pushes the #.2 box down immediately.

Expected behavior

When i drag it a little bit and it's still outside 2, I don't expect #.2 to be moving.

react-grid-layout library version

1.4.4

Operating System Version

Windows

Browser

Chrome

Additional context

No response

Screenshots or Videos

No response

@xuanxiaoxiao
Copy link

When rowHeight<10, this problem will occur. You can try setting a relatively large value

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants