#7498 closed feature (fixed)
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:
- On an empty div.
- call .tabs()
- call .sortable()
- add tabs with .tabs('add', .. )
- 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.
Change History (16)
comment:1 Changed 12 years ago by
comment:2 Changed 11 years ago by
Type: | enhancement → feature |
---|
comment:3 Changed 11 years ago by
Milestone: | 1.9.0 → 2.0.0 |
---|
comment:4 Changed 11 years ago by
Status: | new → open |
---|
Consider for redesign. Make sortable just work in that case or have user call refresh(), and document as such.
comment:5 Changed 11 years ago by
Summary: | Sortable/tabs issue when calling .sortable() before dynamically adding tabs → Sortable: Floating detection only occurs during initialization |
---|
comment:6 Changed 11 years ago by
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.
comment:13 Changed 9 years ago by
Resolution: | → fixed |
---|---|
Status: | open → closed |
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
comment:14 Changed 9 years ago by
Milestone: | 2.0.0 → 1.12.0 |
---|
comment:15 Changed 9 years ago by
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
comment:16 Changed 9 years ago by
Milestone: | 1.12.0 → 1.11.4 |
---|
#7918 is a duplicate of this ticket.