Skip to main content

Bug Tracker

Side navigation

#6150 closed bug (fixed)

Opened February 23, 2010 01:32PM UTC

Closed September 28, 2011 03:59PM UTC

.stop sometimes doesn't clear .delay

Reported by: cowboy Owned by: gnarf
Priority: blocker Milestone: 1.7
Component: effects Version: 1.4.1
Keywords: delay,stop,setTimeout,1.7-discuss Cc:
Blocked by: Blocking:
Description

If .stop is called after the setTimeout in .delay has executed, there's no way for that setTimeout to be stopped, so the callback executes after "time" milliseconds, no matter what.

Attachments (0)
Change History (25)

Changed June 15, 2010 12:10AM UTC by dmethvin comment:1

component: unfiledfx

Changed November 04, 2010 04:15PM UTC by addyosmani comment:2

owner: → cowboy
priority: → undecided
status: newpending

Please submit a valid test case that reproduces this issue.

Changed November 04, 2010 07:58PM UTC by cowboy comment:3

status: pendingnew

Here you go, sorry I never added this into the ticket!

http://jsfiddle.net/cowboy/xxvFa/

Changed November 10, 2010 04:46PM UTC by SlexAxton comment:4

keywords: → delay stop setTimeout
milestone: 1.4.21.5
priority: undecidedlow
status: newopen

Appreciate the test case, ben.

Changed March 30, 2011 07:19PM UTC by cowboy comment:5

owner: cowboyjohn
status: openassigned

Changed March 30, 2011 07:49PM UTC by john comment:6

milestone: → 1.next
priority: lowblocker

Changed April 17, 2011 05:58PM UTC by john comment:7

#6576 is a duplicate of this ticket.

Changed May 14, 2011 07:58PM UTC by T.J. Crowder comment:8

Just "me too"-ing. stop() should stop delays. It seems like it should be really easy to implement delay() as an animation of the given duration that doesn't actually change anything (if, unlike me, you already understand how jQuery's animation infrastructure works). That would make it play nicely with the various other animation functions (like stop()).

Changed May 22, 2011 07:27PM UTC by john comment:9

keywords: delay stop setTimeoutdelay,stop,setTimeout,1.7-discuss

Nominating ticket for 1.7 discussion.

Changed May 22, 2011 08:29PM UTC by gnarf comment:10

You could just animate a non-property

$.fn.delay = function( duration ) {
    return this.animate({
       _: 0
    }, duration);

However, This brings up a great point.... stopHooks...

There are a lot of UI effects that CANT be .stop()'ed because they don't actually use the queue... It might be nice to create some sort of method that non-standard animates can provide a function to be called on stop...

Imagine:

$.fn.delay = function( duration ) {
    return this.queue( function( next, onstop ) {
       var timer = setTimeout( next, duration );
       onstop( function( gotoEnd ) {
         clearTimeout( timer );
         if ( gotoEnd ) {
            next();
          }
       });
    });
};

Changed May 22, 2011 10:24PM UTC by rwaldron comment:11

+1, Sounds like a bug, should be fixed

Changed May 22, 2011 11:58PM UTC by jaubourg comment:12

+1, Sounds like a nasty little bug

Changed May 23, 2011 01:54AM UTC by ajpiano comment:13

+1, Exterminate!

Changed May 23, 2011 03:07AM UTC by timmywil comment:14

+1, could this be fixed by simply adding the setTimeout timer to jQuery.timers?

Changed May 23, 2011 03:41PM UTC by danheberden comment:15

+1

Changed May 23, 2011 09:27PM UTC by dmethvin comment:16

+1, Do not annoy the cowboy.

Changed June 03, 2011 01:27PM UTC by john comment:17

+1

Changed June 03, 2011 02:29PM UTC by scottgonzalez comment:18

+1, clearly just an implementation bug

Changed June 06, 2011 03:41PM UTC by jzaefferer comment:19

+1

Changed June 06, 2011 03:52PM UTC by cowboy comment:20

+1, heh

Changed July 11, 2011 09:22PM UTC by john comment:21

milestone: 1.next1.7

Changed July 25, 2011 04:13PM UTC by john comment:22

owner: johngnarf

Changed August 01, 2011 04:16PM UTC by john comment:23

milestone: 1.71.6.3

Changed August 22, 2011 05:41PM UTC by timmywil comment:24

milestone: 1.6.31.7

We are currently favoring a fix for this that would include an additional parameter for delay and considering delay has always behaved this way, we're going to push this to 1.7.

Changed September 28, 2011 03:59PM UTC by Corey Frang comment:25

resolution: → fixed
status: assignedclosed

Landing pull request 514. 1.7 - queue refactoring to handle delay stop - Fixes #6150.

More Details:

Changeset: a3b59d7f92c9e15af1888fc4e87639a290763a50