I have created a page where users can interact with green blocks by dragging and re-ordering them from one sliding area to another. Sometimes, however, the dropping and sorting functionality is unreliable. The boxes may align incorrectly or the drop area might disappear altogether.
When I drag the top left block, it causes the lower block to jump to the other side. This issue seems to be related to the placeholder option in the JavaScript code.
Another concern is that sometimes the placeholder does not even show when dragging a block from the right area to the left.
To address some of these issues, I had to use
$( "#areaOne, #areaTwo" ).sortable( "refresh" );
in the code, but it still doesn't fully resolve the problem.
If you have any ideas on how to fix these unpredictable sortable issues, please let me know!
You can view the live code here.
UPDATE:
By removing the border from the placeholder class, I was able to eliminate the 'jumping' issue. However, the problem of the placeholder disappearing persists when dragging a block between areas. It seems like the scrolling behavior triggers this issue.
Upon inspecting the live HTML code, I noticed that when the placeholder vanishes, it actually jumps back to its original area of origin.
You can find the updated code here.
Here is a screen recording demonstrating the current problem: Watch here.
Your input on resolving these challenges would be greatly appreciated. Thank you.