Opened 12 years ago

Closed 10 years ago

#6958 closed bug (notabug)

Sortable gets confused if you have matching elements with display: none

Reported by: neilbowers Owned by: neilbowers
Priority: minor Milestone: 2.0.0
Component: ui.sortable Version: 1.8.9
Keywords: Cc:
Blocked by: Blocking:


I have a container which contains multiple elements with class Foobar. Some of the child elements can be hidden, which I achieve with display: none. But drag and drop gets confused by the non-displayed elements which still have the matching class.

I'm currently working round this by changing the className when I hide the elements, and restoring it when they come back "on screen".

Change History (4)

comment:1 Changed 10 years ago by Scott González


comment:2 Changed 10 years ago by mikesherov

Owner: set to neilbowers
Status: newpending

Thanks for taking the time to contribute to the jQuery UI project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket. I'm not sure what "gets confused" means, and the specifics of the situation in which you encountered this bug.

Additionally, be sure to test against the git version of both jQuery UI and jQuery to ensure the issue still exists. To get you started, use this boilerplate: Open the link and click to "Fork" (in the top menu) to get started.

comment:3 Changed 10 years ago by neilbowers

Status: pendingnew

Here's a jsfiddle:

That wasn't a very good bug report, was it. Sorry.

I've just tested with a much more recent jQuery and jQuery UI. In my example, one element (tile #4) has display: none. The only point I might make now is that the serialize is including tile 4 in the serialization.

My vague recollection is that it was more than just the serialization issue, but whatever it might have been, I'm not seeing it now.

comment:4 Changed 10 years ago by Scott González

Resolution: notabug
Status: newclosed

I'd say that's working as expected with the serialization, since it is still a valid item according to the items option. I'll close as notabug since we're not sure what exactly was being reported.

Note: See TracTickets for help on using tickets.