Ticket #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: | |
| Blocking: | Blocked by: |
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
comment:2 Changed 7 months ago by scott.gonzalez
- Keywords regression added
- Priority changed from minor to blocker
- Milestone changed from 1.10.0 to 1.9.1
May be caused by #8670.
comment:3 Changed 7 months ago by petersendidit
- Owner set to petersendidit
- Status changed from open to assigned
comment:4 Changed 7 months ago by petersendidit
Pull request to fix this issue: https://github.com/jquery/jquery-ui/pull/773
comment:6 Changed 7 months ago by David Petersen
- Status changed from assigned to closed
- Resolution set to fixed
Dialog: Use _hide() to make sure close event gets triggered. Fixes #8684 - jQuery dialog with hide options does not trigger close event.
Changeset: 35dc9307fc2ce5d2016e8848fdc578829867f97e


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