-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Bug with moving items breakpoints #2053
Comments
Here's a video showing the issue: Screenshot.2024-07-08.16.19.05.mp4The breakpoint for vertically swapping items is too low. It feels like the breakpoint should instead be at the midpoint of the old and new positions: In other words, try to place the item at the nearest possible position to where it's being hovered. |
Experiencing the same problem, appears to be some undesired behaviour with the collision detection movement rgl-collision-detection-movement.mp4I tried testing locally and following the movement logic, it looks like the issue occurs when a smaller element collides with a larger element from above in the grid layout. My hunch is that is the condition that handles collisions from above looks to move the element y 1 units in the grid, but with the smaller elements this doesn't seem to be enough to actually swap positions in the layout after compaction. Based off the videos it appears the smaller item needs be way past the midpoint of the bigger element, ~ around 1 unit from the bottom until the two elements actually swap in the layout. Any context on why this may be @STRML? |
Describe the bug
In certain conditions items breakpoints are not coherent with expected behaviour when dragging elements. Breakpoints when items are considered moved is broken when you try to move a smaller block over a big one
Your Example Website or App
https://react-grid-layout.github.io/react-grid-layout/examples/0-showcase.html
Steps to Reproduce the Bug or Issue
Expected behavior
I think the behaviour of the elements should be the same independently of items size.
react-grid-layout library version
1.4.1
Operating System Version
macOS
Browser
Chrome
Additional context
No response
Screenshots or Videos
No response
The text was updated successfully, but these errors were encountered: