Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#8684 closed bug (fixed)

jQuery dialog with hide options does not trigger close event

Reported by: MarcoVanK Owned by: petersendidit
Priority: blocker Milestone: 1.9.1
Component: ui.dialog Version: 1.9.0
Keywords: regression Cc:
Blocked by: Blocking:

Description

When using the Close event in combination with a hide option the close event won't be triggered anymore. See http://jsfiddle.net/V3eg4/3/ for an example.

The problem (i think) is that the callback method supplied to this.uiDialog.hide is not processed correctly in the _normalizeArguments method.

In the dialog.close method i modified the following lines

if ( this.options.hide ) {

this.uiDialog.hide( this.options.hide, function() {

that._trigger( "close", event );

});

} else {

this.uiDialog.hide(); this._trigger( "close", event );

}

into

if ( this.options.hide ) {

this.options.hide.complete = function() {

that._trigger( "close", event );

}; this.uiDialog.hide( this.options.hide);

} else {

this.uiDialog.hide(); this._trigger( "close", event );

}

With this modification the close event is triggered correctly, not sure if this is the best solution though...

Change History (7)

comment:1 Changed 4 years ago by tj.vantoll

  • Status changed from new to open

Verified. Here's a minimal fiddle - http://jsfiddle.net/tj_vantoll/c8G2g/.

comment:2 Changed 4 years ago by scottgonzalez

  • Keywords regression added
  • Milestone changed from 1.10.0 to 1.9.1
  • Priority changed from minor to blocker

May be caused by #8670.

comment:3 Changed 4 years ago by petersendidit

  • Owner set to petersendidit
  • Status changed from open to assigned

comment:4 Changed 4 years ago by petersendidit

Pull request to fix this issue: https://github.com/jquery/jquery-ui/pull/773

comment:5 Changed 4 years ago by scottgonzalez

#8695 is a duplicate of this ticket.

comment:6 Changed 4 years ago by David Petersen

  • Resolution set to fixed
  • Status changed from assigned to closed

Dialog: Use _hide() to make sure close event gets triggered. Fixes #8684 - jQuery dialog with hide options does not trigger close event.

Changeset: 35dc9307fc2ce5d2016e8848fdc578829867f97e

comment:7 Changed 4 years ago by scottgonzalez

#8579 is a duplicate of this ticket.

Note: See TracTickets for help on using tickets.