-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Description
Note: This issue description was drafted with assistance from an AI. Please excuse any formatting inconsistencies😅
Describe the bug
When using a grid layout, there's an issue with the first item in each row. When dragging the first item towards the last position in the row, other items in the same row continuously swap positions back and forth, creating a flickering effect. This happens consistently and makes it difficult to place the item in the desired position.
To Reproduce
- Create a grid layout with multiple items per row (2 or more columns)
- Click and drag the first item in a row
- Try to move it to the last position in the same row
- Observe how other items in the row continuously swap positions back and forth
Expected behavior
Items should maintain stable positions during dragging, and only swap when the dragged item passes the threshold for repositioning. There should be no continuous back-and-forth repositioning of other items.
Information
Versions - Look in your package.json
for this information:
sortablejs = ^1.15.6
@types/sortablejs = ^1
Additional context
- This issue occurs in the official grid examples as well
- The problem is reproducible across different browsers and devices
- The issue is more noticeable on mobile devices with smaller screens
Reproduction
This issue can be easily reproduced using the official grid example at https://sortablejs.github.io/Sortable/#grid
Steps to reproduce with the official example:
- Visit https://sortablejs.github.io/Sortable/#grid
- Reduce your browser window width until the items display in 2-3 columns per row
- Click and hold on the first item in any row (e.g., item 1)
- Drag it towards the end position of the same row
- Observe how other items in the row continuously swap positions back and forth as you approach the end of the row