I've noticed that if you assign an event handler to the dialog's "onclose" property (or attribute), it is not called on dialog close. I think this should be mentioned in the "Limitations" section.
On the other hand, I've made a custom version of the polyfill that supports the "onclose" property (not the attribute). What I've done is to add the following code in the dialogPolyfillInfo.close method:
close: function(opt_returnValue) {
...
// Call the "onclose" event handler
if (typeof this.dialog_.onclose == 'function') {
this.dialog_.onclose({
type: 'close',
bubbles: false,
cancelable: false,
composed: false,
defaultPrevented: false,
isTrusted: true,
eventPhase: Event.AT_TARGET,
target: this.dialog_,
currentTarget: this.dialog_,
returnValue: this.dialog_.returnValue
});
}
// Triggering "close" event for any attached listeners on the <dialog>.
...
Feel free to use this as the starting point for a proper implementation.
I've noticed that if you assign an event handler to the dialog's "onclose" property (or attribute), it is not called on dialog close. I think this should be mentioned in the "Limitations" section.
On the other hand, I've made a custom version of the polyfill that supports the "onclose" property (not the attribute). What I've done is to add the following code in the
dialogPolyfillInfo.close
method:Feel free to use this as the starting point for a proper implementation.