Ticket #7734 (open bug)

Opened 3 years ago

Last modified 21 months ago

Draggable: HTML IDs are removed when dragging to a Sortable

Reported by: azaozz Owned by:
Priority: minor Milestone: 2.0.0
Component: ui.draggable Version: 1.8.13
Keywords: Cc: scott.gonzalez
Blocking: Blocked by:


This was introduced in #4564 as a bug fix but seems to cause more problems than it fixes.

The patch removes the ID from the draggable element (but doesn't remove the IDs from any child elements) preventing proper handling of that element when it's dropped in the sortable. This breaks the Widgets page in WordPress among other things.

Furthermore this patch doesn't solve the problem of duplicate IDs. If there are child elements with IDs, they still create duplicates.

The solution imho would be to revert that patch, then update the documentation on using both draggable + sortable together. The draggable elements should be without IDs or the author should handle the duplicate IDs.

(Would have set the ticket type as regression if it was available.)

Change History

comment:1 Changed 3 years ago by azaozz

Related ticket on WprdPress' trac:  https://core.trac.wordpress.org/ticket/17952

comment:2 Changed 22 months ago by scott.gonzalez

  • Milestone changed from 1.9.0 to 2.0.0

comment:3 Changed 21 months ago by mikesherov

  • Cc scott.gonzalez added

Not sure whether this is something we intend on fixing. Scott, can you chime in here on the issue... mark as open if we're going to tackle this, or resolve as wontfix if we're not. Thanks!

comment:4 Changed 21 months ago by mikesherov

  • Summary changed from HTML IDs are removed when dragging an item from a Draggable to a Sortable to Draggable: HTML IDs are removed when dragging to a Sortable

comment:5 Changed 21 months ago by mikesherov

  • Type changed from bug to feature

comment:6 Changed 21 months ago by scott.gonzalez

  • Status changed from new to open
  • Type changed from feature to bug

This seems legit, I'd even say bug was correct since this is expected behavior and was implemented for a long time. I haven't dug into the code to figure out why clones are always used when connecting to sortables, but I can't think of any reason that should be necessary.

Note: See TracTickets for help on using tickets.