With enabled drag nesting, when trying to move a term, rows keeping jumping/vibrating around. It's very difficult to hit a moving target :) See attachment.

With disabled drag nesting, it works fine.

Tried to adjust swapThreshold, invertedSwapThreshold, emptyInsertThreshold in "etm-sortable.js", no result.

Drupal 10.2.6, Chrome.

Comments

dudás gábor created an issue. See original summary.

  • 36324458 committed on 2.2.x
    Issue #3619454: Stop rows jumping while drag-nesting
    
    The empty child...

  • 3b06bfcd committed on 2.2.x
    Issue #3619454: Keep the drop-zone CSS on one line, as CI's stylelint...
deadnorth’s picture

Status: Active » Fixed

Thanks for the recording. It showed the problem exactly. Fixed in 2.2.2.

With drag nesting on, every childless term shows a "nest as child" drop zone during a drag, and two things fed each other:

  • SortableJS applies emptyInsertThreshold on every dragover, even over another row. At 60px, with a zone under every row, the dragged term was pulled into a nearby zone, then the row under the pointer pulled it back out. Browsers keep firing dragover while the pointer rests, so it never settled.
  • A zone lost its size the moment the dragged term entered it, because its styling depended on :empty, and grew when its parent was highlighted. Either way the rows under the pointer moved.

That is why the swap thresholds made no difference, and why emptyInsertThreshold alone wasn't enough. The zones now keep one size, matching the dragged row, and the nearby-zone pull is off, so a zone takes a term when it is dropped on it. In a scripted test that held the pointer still at 82 positions down a list of 13 sibling terms, the dragged row jumped 814 times before the fix. After it, it moved only while the page itself auto-scrolled near the bottom edge.

After updating, clear caches so the browser gets the new CSS and JavaScript. If it still happens, please reopen this with your browser and its version.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.