ESC key causing model to close

1
  Hi All, I have a scenario where modal should not be closed when user presses escape key.. I tried disabling the esc key using javascript however it did not work. Is there a way to disable the ESCAPE key or any option/widget which will avoid closing the modal on press of escape key.   Thanks in advance.       the escape key on Modal or any option/widget which will not close the modal  
asked
2 answers
0

Seeing your comment at Henri, the solution is very simply.

Add a button on the page with action ‘Do nothing’ and add the CSS styling ‘display: none’. Then change the page properties (where you can change the page title) and at the bottom you can select which action you want to connect to the close button (that is also triggered by ESC key).

This way, if you press Esc, thus clicking on the X close button, you trigger the activity ‘Do nothing’.

Good luck!

answered
-1

If it’s a default behavior that ESC closes a modal, you should not change this default behavior. The user expects that ESC can be used to close.

You can you explain what you want to achieve? Maybe it’s better to use a normal page instead of a modal.

answered