Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy is this jQuery sortables setup so unreliable/unstable?
    primarykey
    data
    text
    <p>I have a page setup where the main aim is to allow users to drag and re-order a set of green blocks from one sliding area to another (have a go by dragging a block to the right of the container).</p> <p>The problem is that when I drag them from area to area the dropping and general sortable-ness is unreliable in that sometimes the area where you can drop the box disappears, or the boxes align incorrectly (shown in the image below)</p> <p><strong>Before being dragged</strong></p> <p><img src="https://i.stack.imgur.com/dABVB.png" alt="blocks before being dragged"></p> <p><strong>When being dragging</strong></p> <p><img src="https://i.stack.imgur.com/9Flip.png" alt="blocks being dragging"></p> <p>As you can see when the top left block is dragged it cause the lower one to 'jump' over to the other side. I think this could be caused by having the placeholder option in the JS as if I remove it this no longer happens :/</p> <p>Also <strong>(and more worryingly)</strong> when dragging over a block from, e.g. the right area to the left, sometimes a placeholder does not even show!!</p> <p><strong>Placeholder not showing</strong></p> <p><img src="https://i.stack.imgur.com/N8t5Y.png" alt="no placeholder showing on block drag"></p> <p>I had to use <code>$( "#areaOne, #areaTwo" ).sortable( "refresh" );</code> in the code also to get the connected container to even notice a block is being dragged into it! Maybe it is not 'refreshing' correctly..?</p> <p><strong>Does anyone have any ideas as to how I could fix these unreliable/unstable sortable issues?</strong></p> <p><strong>The live code can be found here ></strong> <a href="http://jsfiddle.net/WqZ9m/19/" rel="nofollow noreferrer">http://jsfiddle.net/WqZ9m/19/</a></p> <hr> <h2>UPDATE:</h2> <p>Removing the border from the placeholder class has sorted the 'jumping' issue, but the placeholder still disappears sometimes when a block is being dragged between areas. The issue goes when the scrolling does not take place (ie. when you remove the scrolling code and drag directly from one area to another), so I'm guessing that the issue is within the main 'if' statement.</p> <p>From looking at the live HTML I have also noticed that when the place hold disappears, it's actually jumping back to the area from which it was originally dragged!</p> <p><strong>Updated Code ></strong> <a href="http://jsfiddle.net/WqZ9m/20/" rel="nofollow noreferrer">http://jsfiddle.net/WqZ9m/20/</a></p> <p><strong>Here is a Screen recording of the current problem</strong> > <a href="http://www.youtube.com/watch?v=V-mxOQ2ke28" rel="nofollow noreferrer">http://www.youtube.com/watch?v=V-mxOQ2ke28</a></p> <p>You will see that the placeholder (the yellow area) disappears :/</p> <p>Any replies are really appreciated, thanks</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload