Allow cancelling of list item drag operations with Esc

What does this MR do and why?

This recreates !181665 (closed) on a fresh branch off current master, since that MR had merge conflicts and a failing pipeline after sitting for a while. All credit for the original implementation goes to @markrian; this MR adds the test coverage that was called out as the only missing piece, and resolves the conflicts introduced by unrelated changes to the same files in the meantime (forceFallback / taskListSortableOptions additions to the Sortable.create calls).

Clean up sortable instances

Before, Sortable.js instances weren't cleaned up, which was a memory leak. It doesn't appear to have had any other consequences, but the next commit relies on this cleanup behaviour being present.

Allow cancelling of list drag operations with Esc

This adds a Sortable.js plugin called RevertOnEscape which implements the ability to cancel a drag operation by pressing the Escape key.

Add test coverage

Adds a spec for the new RevertOnEscape plugin (drag/escape/cleanup lifecycle) and extends the description.vue / work_item_description_rendered.vue specs to cover the sortable-instance cleanup behaviour, closing the gap noted in the original MR.

Part of #362955. Replaces !181665 (closed)

References

How to set up and validate locally

  1. Open an issue
  2. Add an un/ordered list to the description
  3. Drag a list item
  4. Press Esc
  5. Observe drag is cancelled correctly
  6. Do the same with an epic
Edited by Radek Antoniuk

Merge request reports

Loading
Loading