Hello,
I am experiencing exactly the same behavior.
As shown in the code I tried to get all the "<li> elements" into the array
"items" and make it "unique", but not even that worked.
(see Source Code).
The only solution was the proposed one:
$(this).children(":last").remove();
Is there any new idea how this could work without a workaround?
Cheers and thanks,
Robert
<code>
jQuery('.sort').sortable({
receive: function(event, ui) {
var items = [];
jQuery('.sort li').each(function(n,item) {
items.push(item.innerHTML);
});
plotGraph(items);
},
update: function(event, ui) {
var items = [];
//$(this).children(":last").remove();
jQuery('.sort li').each(function(n,item) {
items.push(item.innerHTML);
});
items = jQuery.unique(items);
plotGraph(items);
}
});
</code>
JamesN-2 wrote:
>
>
> I'm using draggables and dropping them into a droppable, which is also
> a sortable (all of which are DIVs). The problem occurs when I sort the
> elements in the droppable/sortable list;
>
> * it creates the position: absolute; helper which floats at my mouse
> * it creates a visibility: hidden; placeholder at the position of my
> helper
>
> Which are both fine, but after releasing my helper, it disappears, the
> visibility: hidden; placeholder becomes visible, BUT an additional
> visibility: hidden; element is appended to the droppable/sortable list
> - so my list grows and grows with invisible elements (that take up
> space).
>
> At the moment I'm getting around it by adding;
>
> update: function(ev,ui) {
> $(this).children(":last").remove();
> }
>
> To the sortable... but if you continuously sort enough even this hack
> isn't foolproof.
>
> Let me know if you think this is a potential bug, and I'll post up
> some HTML source code for your perusal.
>
> James
>
> --~--~---------~--~----~------------~-------~--~----~
> You received this message because you are subscribed to the Google Groups
> "jQuery Development" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/jquery-dev?hl=en
> -~----------~----~----~----~------~----~------~--~---
>
>
>
--
View this message in context:
http://old.nabble.com/Sortable-Bug--tp19626712s27240p26631820.html
Sent from the jQuery Dev List mailing list archive at Nabble.com.
--
You received this message because you are subscribed to the Google Groups
"jQuery Development" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/jquery-dev?hl=en.