Skip to main content

Search and Top Navigation

#15339 new bug ()

Opened May 08, 2019 01:53PM UTC

Last modified May 08, 2019 01:53PM UTC

'receive' handler is not called in Sortable under certain conditions

Reported by: slepmog Owned by:
Priority: minor Milestone: none
Component: ui.sortable Version: 1.12.1
Keywords: Cc:
Blocked by: Blocking:
Description

We are using Sortable to drag trs between tbodys of different tables.

We need to be able to drop rows onto empty tables, and because empty tbody has zero height no matter what, we have to use a workaround described in https://stackoverflow.com/a/4350165/11683 (the point is to drag the row onto the div wrapper and use the receive handler to attach the row to tbody instead of the div).

This works very well, except in one following case:

  • There are two tables.
  • You drag and drop a row from one table to another. All looks good.
  • You again start dragging that same row you just dropped onto the second table. While dragging, you move the mouse over the first table (without dropping), then move the mouse back to the second table and finally drop.

In this situation, the receive handler is not called, so the dropped row is attached using the default mechanism, which means it becomes a direct child of the wrapping div.

The problem only occurs when dragging a row that has changed its parent table at least once. If you drag a row that still resides in its original table in that manner, the problem does not occur.

Expected behaviour: EITHER the receive handler is called so that the row could be attached in a proper manner, OR the row is returned to the second table as if revert happened (because, after all, we are dropping it on the same table we started dragging it from).

Reproducible in Firefox 66.0.4 and Chrome 74.0.3729.131.

jsFiddle with instructions: https://jsfiddle.net/zmhbxv7s/

Attachments (0)
Change History (0)