Skip to main content

Bug Tracker

Side navigation

#1683 closed bug (fixed)

Opened September 19, 2007 05:27PM UTC

Closed September 23, 2007 01:36PM UTC

Sortable slow with long lists (partial fix included)

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

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);
                    break;
				}

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

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.

Attachments (0)
Change History (3)

Changed September 19, 2007 11:37PM UTC by sqrrrl comment:1

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

Changed September 23, 2007 12:15PM UTC by paul comment:2

owner: → paul
status: newassigned

Changed September 23, 2007 01:36PM UTC by paul comment:3

resolution: → fixed
status: assignedclosed

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