Opened 9 years ago

Closed 7 years ago

#6921 closed bug (invalid)

Sortable: JS errors when using toleranceElement

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

Description

I tried using toleranceElement when using sortable. It worked great. It's not in the documentation but I found info about it online somewhere and makes sortable work much better.

It stopped working a couple days ago, not sure why. Firebug gives me this error.

e is null this._getParentOffset();for(var f=this...his.containers[f].containerCache.top= jquery-ui.min.js(line139)

I hope you document toleranceElement because it really made sortable feel much better and while you're at it fix whatever is causing it to not work for me.

jquery 1.4.4 jquery ui 1.8.9

Tried in chrome and firefox.

Change History (14)

comment:1 Changed 9 years ago by danimal

If I use jquery-ui instead of jquery-ui.min the error is p is null instead of e is null.

comment:2 Changed 9 years ago by danimal

This started happening when I tried jquery 1.5. If I put this

if (t.offset() == null || t.offset() == 0) {
    t = item.item;
}

at line 3506 it works. t is sometimes null or 0 for some reason.

Last edited 9 years ago by danimal (previous) (diff)

comment:3 Changed 8 years ago by ryanmelt

I submitted a pull request to get this fixed. https://github.com/jquery/jquery-ui/pull/457

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

Owner: set to danimal
Status: newpending

Please provide a reduced test case showing the problem.

comment:5 Changed 8 years ago by trac-o-bot

Resolution: invalid
Status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!

comment:6 Changed 7 years ago by zelenyd1

Here is a jsfiddle showing a small test case with a draggable nested list and a sortable nested list. Strange things start happening when one of the top-level nodes from the draggable list gets dragged on and moved around the sortable nested list. Note that the jsfiddle produces different firebug errors than when you actually run a standalone version of the code. Hopefully this is a sufficiently minimal test case. Removing the toleranceElement from the sortable fixes the problem (but other strange things happen, which are documented in other tickets).

Last edited 7 years ago by zelenyd1 (previous) (diff)

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

Resolution: invalid
Status: closedreopened

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

Milestone: 1.9.02.0.0

comment:9 Changed 7 years ago by mikesherov

Status: reopenedopen

comment:10 Changed 7 years ago by tj.vantoll

#9040 is a duplicate of this ticket.

comment:11 Changed 7 years ago by tj.vantoll

Summary: toleranceElementSortable: JS errors when using toleranceElement

comment:12 Changed 7 years ago by tj.vantoll

The test case for this issue also runs into this problem https://github.com/jquery/jquery-ui/pull/906. I'll minify this down after that gets merged in.

comment:13 Changed 7 years ago by tj.vantoll

Status: openpending

The only valid test case posted on this issue functions correctly as of jQuery UI 1.9.1 - http://jsfiddle.net/tj_vantoll/hE69f/. The test case posted in the duplicate issue fails because toleranceElement expects a jQuery object, not a selector.

I'll mark this as pending for now since I can no longer recreate this problem. If anybody can, let me know and I can reinvestigate.

comment:14 Changed 7 years ago by trac-o-bot

Resolution: invalid
Status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!

Note: See TracTickets for help on using tickets.