Opened 16 years ago

Closed 16 years ago

Last modified 14 years ago

#1683 closed bug (fixed)

Sortable slow with long lists (partial fix included)

Reported by: sqrrrl Owned by: paul
Priority: major Milestone: 1.5
Component: ui.core Version: 1.2.1
Keywords: Cc:
Blocked by: Blocking:


Dragging sortables with long lists is slow. There is a significant lag when the lists get to be > 50 items. I found one very quick fix, which at least addresses sorting near the top half of the list.

In drag, simply breaking the loop once an overlapping element is found speeds things up dramatically. I added breaks as shown...

				if(overlap >= 0 && overlap <= 0.5) { //Overlapping at top
					ci.prev().length ? ma(this.element) : mb(this.element);

				if(overlap < 0 && overlap > -0.5) { //Overlapping at bottom[0] == this.element ? mb(this.element) : ma(this.element);

Another possibility, which I haven't tried yet, is to track element positions during drag so we check for overlaps with the closest elements first rather than restarting at the top of the list each time.

Change History (5)

comment:1 Changed 16 years ago by sqrrrl

BTW - See ticket #1680 for modified version that contains several performance fixes.

comment:2 Changed 16 years ago by paul

Owner: set to paul
Status: newassigned

comment:3 Changed 16 years ago by paul

Resolution: fixed
Status: assignedclosed

Added the breaks! I'm investigating more speed fixes.

comment:4 Changed 15 years ago by (none)

Milestone: 1.2.1

Milestone 1.2.1 deleted

comment:5 Changed 14 years ago by paul

Milestone: 1.5
Note: See TracTickets for help on using tickets.