cancel
Showing results for 
Search instead for 
Did you mean: 

How to override a dialog close on <ESC> key?

Former Member

Hi

I have a dialog that opens up on an event. However, on press of <ESC> key it closes the dialog. Is there a way to override this or avoid this.

Regards

Harshad

Accepted Solutions (0)

Answers (1)

Answers (1)

konstantin_anikeev
Active Contributor

As quick & dirty solution you can try:

Disabling escape key for all dialogs:

sap.ui.commons.Dialog.prototype.onsapescape = function(){ };

Original looks like that:

sap.ui.commons.Dialog.prototype.onsapescape = function(e){this.close();e.preventDefault();e.stopPropagation()};