Prevent Editor modal from closing on escape key

Prevent Editor modal from closing on escape key

dsteinbergdsteinberg Posts: 20Questions: 6Answers: 1

Hello! The default behavior for the "create" modal is to close when the escape key is pressed. How can I disable this behavior?

The jQuery event passed to preClose isn't the keypress but rather an instance of the preClose event, so I can't detect that was the event which triggered the preClose and return the cancellation.

I know I could intercept the keystroke and prevent it from propagating to dt but I strongly suspect it's just a configuration option I'm missing.

Thanks!

This question has an accepted answers - jump to answer

Answers

  • dsteinbergdsteinberg Posts: 20Questions: 6Answers: 1

    Update: I found the solution in the formOptions.main setting. The solution was to set formOptions.main.onEsc to false on Editor initialization.

  • allanallan Posts: 61,697Questions: 1Answers: 10,102 Site admin
    Answer ✓

    Hi,

    Thanks for posting back. You are absolutely spot on - this is the way to control that behaviour.

    Allan

This discussion has been closed.