Skip to main content

Search and Top Navigation

#7498 closed feature (fixed)

Opened June 23, 2011 03:11AM UTC

Closed November 04, 2014 01:16PM UTC

Last modified March 10, 2015 04:15PM UTC

Sortable: Floating detection only occurs during initialization

Reported by: jamesh Owned by:
Priority: minor Milestone: 1.11.4
Component: ui.sortable Version: 1.8.13
Keywords: Cc:
Blocked by: Blocking:
Description

Tested with Firefox 4.0.1 on Windows 7.

jQuery UI 1.8.13

Example:

http://jsfiddle.net/RS6bg/1/

Reproduce:

1. On an empty div.

2. call .tabs()

3. call .sortable()

4. add tabs with .tabs('add', .. )

5. Sorting is then partially broken.

this.floating is only determined during _create() (on line 53 in jquery.ui.sortable.js), so when floating items are added later on this.floating is incorrect.

I'm not sure whether this is indeed a bug, or just misuse, as I have fixed my problem by moving the .sortable() after .tabs('add').

Perhaps advising the user of this potential problem in the tabs documentation.

Attachments (0)
Change History (16)

Changed November 28, 2011 01:12PM UTC by scottgonzalez comment:1

#7918 is a duplicate of this ticket.

Changed June 26, 2012 01:22AM UTC by scottgonzalez comment:2

type: enhancementfeature

Changed October 11, 2012 02:55PM UTC by scottgonzalez comment:3

milestone: 1.9.02.0.0

Changed November 05, 2012 12:32PM UTC by jzaefferer comment:4

status: newopen

Consider for redesign. Make sortable just work in that case or have user call refresh(), and document as such.

Changed February 05, 2013 09:07PM UTC by scottgonzalez comment:5

summary: Sortable/tabs issue when calling .sortable() before dynamically adding tabsSortable: Floating detection only occurs during initialization

Changed March 11, 2013 03:12AM UTC by tj.vantoll comment:6

The internal

floating
flag is also used to determine horizontal vs. vertical sorting.

And, because

this.floating
is only determined in
_create
, if you start with an empty sortable it is assumed to be vertical. You can see the problem this creates in the following two examples:

Vertical works: http://jsfiddle.net/tj_vantoll/4A42n/ Horizontal doesn't: http://jsfiddle.net/tj_vantoll/s867Q/

Another reason to have

refresh
update this value.

Changed March 12, 2013 01:02AM UTC by tj.vantoll comment:7

#8540 is a duplicate of this ticket.

Changed May 09, 2013 07:22PM UTC by tj.vantoll comment:8

#9279 is a duplicate of this ticket.

Changed July 22, 2013 06:15PM UTC by tj.vantoll comment:9

#9443 is a duplicate of this ticket.

Changed June 02, 2014 02:55PM UTC by tj.vantoll comment:10

#10083 is a duplicate of this ticket.

Changed October 31, 2014 12:26PM UTC by tj.vantoll comment:11

#10678 is a duplicate of this ticket.

Changed October 31, 2014 01:54PM UTC by tj.vantoll comment:12

Changed November 04, 2014 01:16PM UTC by TJ VanToll comment:13

resolution: → fixed
status: openclosed

Sortable: Redetermine floating flag when recalculating positions

This addresses a bug where users initialize empty sortable lists are

add items dynamically. In this situation refresh() should recognize the

position and orientation of the new items.

Fixes #7498

Closes gh-1381

Changeset: f656aebe3f99356b7eb91ffdafe6689ecc8fb4ae

Changed November 04, 2014 01:17PM UTC by tj.vantoll comment:14

milestone: 2.0.01.12.0

Changed March 10, 2015 04:11PM UTC by TJ VanToll comment:15

Sortable: Redetermine floating flag when recalculating positions

This addresses a bug where users initialize empty sortable lists are

add items dynamically. In this situation refresh() should recognize the

position and orientation of the new items.

Fixes #7498

Closes gh-1381

(cherry picked from commit f656aebe3f99356b7eb91ffdafe6689ecc8fb4ae)

Changeset: 189f1d476c2d6f53c88f9e92bdaffbc64ed9c572

Changed March 10, 2015 04:15PM UTC by scottgonzalez comment:16

milestone: 1.12.01.11.4