Skip to main content

Bug Tracker

Side navigation

#9774 closed bug (wontfix)

Opened July 07, 2011 12:50PM UTC

Closed July 07, 2011 02:17PM UTC

Last modified July 27, 2011 07:56PM UTC

.promise() after animation not returned properly (working in 1.6.1)

Reported by: albert@ulabox.com Owned by:
Priority: low Milestone: 1.next
Component: effects Version: 1.6.2
Keywords: neededdocs Cc:
Blocked by: Blocking:
Description

If there are some nested animations, the promise is not being properly returned, so the .done() action is never executed. I attach some jsfiddle code.

If you change de version to 1.6.1 you will properly see the .done() being executed.

http://jsfiddle.net/EgMqN/2/

Thanks for your time :)

Attachments (0)
Change History (7)

Changed July 07, 2011 01:25PM UTC by timmywil comment:1

component: unfiledeffects
priority: undecidedlow
status: newopen

Confirmed. I would expect the done to be executed at least after the first animation, although the mixture of passing callbacks and using deferreds is odd to me.

http://jsfiddle.net/timmywil/EgMqN/3/

Changed July 07, 2011 02:07PM UTC by albert@ulabox.com comment:2

timmy,

actually i found out that the problem is caused by the $(this).remove(). I guess that the promise is destroyed in the .remove() action.

http://jsfiddle.net/EgMqN/6/

Changed July 07, 2011 02:17PM UTC by timmywil comment:3

keywords: → needsdocs
resolution: → wontfix
status: openclosed

Oh, that makes sense. Sorry I missed it. The data for the promise needs to be on the element so I don't think we can fix this, but it might be something we want to document.

Changed July 07, 2011 02:40PM UTC by albert@ulabox.com comment:4

Mmm, then the bug was in jQuery 1.6.1? I think we might still consider it a bug as it was something that (in my humble opinion) was working in the previous version and none of the 1.6.2 changes should have broken it.

Either way, im going to put the remove() in the deferred callback, not in the animation one as i guess it's the proper way to do it.

Changed July 07, 2011 03:33PM UTC by timmywil comment:5

This is the commit that caused the change in behavior: 3486365062cdc7e8598cea238e67aafa33af7dce

The remove is completed before the deferred is dequeued.

I imagine this may work differently once jQuery.Callbacks is introduced in 1.7.

Changed July 27, 2011 12:08PM UTC by addyosmani comment:6

keywords: needsdocsneededdocs

docs updated for deferred.promise to reflect the above.

Changed July 27, 2011 07:56PM UTC by gnarf comment:7

I almost feel that removing the element before its animation promises can resolve should probably reject the promise instead of resolve it, but thats just a random thought.