#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 11 years ago by
Status: | new → open |
---|
comment:2 Changed 11 years ago by
Keywords: | regression added |
---|---|
Milestone: | 1.10.0 → 1.9.1 |
Priority: | minor → blocker |
May be caused by #8670.
comment:3 Changed 11 years ago by
Owner: | set to petersendidit |
---|---|
Status: | open → assigned |
comment:4 Changed 11 years ago by
Pull request to fix this issue: https://github.com/jquery/jquery-ui/pull/773
comment:6 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → 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
Verified. Here's a minimal fiddle - http://jsfiddle.net/tj_vantoll/c8G2g/.