Opened 9 years ago

Closed 9 years ago

Last modified 7 years ago

#5797 closed bug (worksforme)

callback to $('.ui-dialog).fadeOut() gets triggered twice

Reported by: jf Owned by:
Priority: minor Milestone:
Component: ui.dialog Version: 1.8.2
Keywords: dialog fadeout callback twice Cc:
Blocked by: Blocking:

Description

This issue bugged me for a long time before I figured out that this was happening. To see clearly what's happening, try the following code once you have a dialog open:

$('.ui-dialog').fadeOut(1000, function() {

alert('fadeout callback');

});

You'll see that the callback gets called twice. Once immediately when the fadeout starts, and then the second time when the *real* callback ought to happen (ie., after the fadeout).

There is a workaround for this (but this is still a bug/surprise):

$('.ui-dialog').delay(1000, 'FF').queue('FF', function() {

alert('fadeout callback');

}).dequeue('FF');

Change History (4)

comment:1 Changed 9 years ago by Scott González

Resolution: worksforme
Status: newclosed

This is working properly. You probably have two dialogs on the page, one is already hidden and is visible.

comment:2 in reply to:  1 ; Changed 9 years ago by Scott González

Replying to scott.gonzalez:

This is working properly. You probably have two dialogs on the page, one is already hidden and is visible.

"...and *one* is visible"

comment:3 in reply to:  2 Changed 9 years ago by jf

Replying to scott.gonzalez:

Replying to scott.gonzalez:

This is working properly. You probably have two dialogs on the page, one is already hidden and is visible.

"...and *one* is visible"

wow, you're right!! thanks. I can't believe i didnt catch that... One question though - why does the workaround work in this case?

comment:4 Changed 7 years ago by Scott González

Milestone: TBD

Milestone TBD deleted

Note: See TracTickets for help on using tickets.