Search and Top Navigation
#8980 closed bug (duplicate)
Opened January 18, 2013 11:52AM UTC
Closed August 21, 2014 01:21AM UTC
Draggable: Error when removing item inside sortreceive callback
Reported by: | mrpaulbarrett | Owned by: | mrpaulbarrett |
---|---|---|---|
Priority: | minor | Milestone: | none |
Component: | ui.draggable | Version: | 1.9.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Setting up two sets of sortable Tabs, so that the tabs can be dragged and dropped between windows.
On the first occurrence of a drag and drop, the tab and its associated div are correctly moved but inspecting in Firebug I get:
TypeError: $(...).data(...) is undefined var o = $(this).data('draggable').options; (jquery-ui-1.9.2.js line 2186)
Trying to move the same tab back to the original Tabs set does not work, the tab <li> is not accepted, however the drop method within droppable is triggered. Dragged tabs do not lose sortable behaviour.
It looks like the draggable options are not transferred to the helper clone during the drag operation. I consider this to be a bug.
I have set up a JSFiddle at http://jsfiddle.net/paulbarrett/ET4xq/ which demonstrates this problem. Drag any tab to the other tab set, then try and drag it back.
I am using jquery 1.9 and jquery ui 1.9.2
Attachments (0)
Change History (8)
Changed January 18, 2013 12:55PM UTC by comment:1
owner: | → mrpaulbarrett |
---|---|
status: | new → pending |
Changed January 18, 2013 01:12PM UTC by comment:2
status: | pending → new |
---|
I'm doing this so that I can have multiple tabs where any two can be visible side-by-side, independent of where they are initially placed. Say I have tabs 1,2,3,4 and 5,6,7,8 and would like to see 6 and 7 side by side. That's what I'm trying to achieve. i don't think that's unreasonable.
I will try and assemble a test case as described.
Changed January 18, 2013 01:16PM UTC by comment:3
My question is why are they draggable and not just sortable? I'm just curious.
Changed January 18, 2013 01:26PM UTC by comment:4
Sortable on it's own would mean that i am limited to 1,2,3,4 on the left and 5,6,7,8 on the right.
The user might want 6 and 7 to be viewed simultaneously, so drags 6 over to the left then to move back so that 1 and 6 can be viewed together. Draggable/Droppable is the only way to accomplish this, since sortables are limited to the scope of their container. The main aim of this is so that I do not have multiple instances of elements within the tabs.
Changed January 18, 2013 01:37PM UTC by comment:5
Changed January 18, 2013 01:40PM UTC by comment:6
A simplified test case here, with tabs not involved:
http://jsfiddle.net/paulbarrett/9Zgm9
You can drag one item from one list to the other, it is accepted, is still sortable, but then dragging that item back to the original list makes it disappear, i.e. not accepted. Expected behaviour should be that the list items should be draggable and droppable between lists as connectWith is based on a class selector (not ID as demonstrated in the connectWith docs).
Changed January 18, 2013 02:50PM UTC by comment:7
status: | new → open |
---|---|
summary: | Sortable tab cloning cannot access data('draggable') → Draggable: Error when removing item inside sortreceive callback |
Thanks. Here's a fully reduced test case: http://jsfiddle.net/9Zgm9/3/
Why are you making tabs draggable and sortable? It's really hard to tell what you're trying to accomplish by doing that. This looks like a bug with a combination of draggable + cursor + sortable + removing elements. Would you mind putting together a test case that doesn't include tabs? The less code the better. Thanks.