Opened 9 years ago

Closed 7 years ago

#5040 closed bug (worksforme)

Safari jQuery UI sortable loses behavior when showing/hiding container elements

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

Description

$(".someUl").sortable({ ... }).disableSelection();

$(".containerOfSomeUl").hide();

$(".someButton").click(function() {

$(".containerOfSomeUl").show();

});

The above works fine in Firefox and IE, but not in Safari (but Chrome works). After I hide and later show the container, someUl loses all sortable behavior and does not work. I googled and found there were some problems around Webkit and sortable, but those were older and appeared to be fixed.

It is specifically about showing and hiding the container. If the container is visible at all times, sortable works fine in Webkit, but this is not what I need. I would like to show and hide the container while keeping sortable working at all times.

Ideas for fix/workaround so it would also work in Safari?

See a live demo with the bug at: http://www.jaanuskase.com/stuff/sortableBug/

This works OK on Firefox and Chrome, does not work with Safari. You see that the sortable code is run on page load. I thought that it might help to instead run it when the sortable element becomes visible, but there's no difference (if I did that, it still works with Firefox, doesn't with Safari).

Change History (2)

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

Milestone: TBD2.0.0

comment:2 Changed 7 years ago by mikesherov

Resolution: worksforme
Status: newclosed

Thanks for taking the time to contribute to the jQuery UI project! I can no longer reproduce the issue using the latest jQuery and jQuery UI in the lowest version of Safari that we support. http://www.jaanuskase.com/stuff/sortableBug/

If you can still reproduce it, please feel free to reply to this ticket with a new test case showing the problem. Thanks!

Note: See TracTickets for help on using tickets.