AP.dialog property closeOnEscape is ignored

Hey,

i need to prevent dialog containing macro editor to close on esc key.
I’ve looked into docs Javascript API dialog and found there should be property just for that. Unfortunately if i set closeOnEscape to false event is still triggered.

Code:

function openReactEditorDialog(customData) {
    AP.dialog.create({
        key: 'react-editor-dialog',
        width: '100%',
        height: '100%',
        customData: customData,
        closeOnEscape: false,
    }).on('close', () => {
        AP.dialog.close();
    });

    AP.dialog.isCloseOnEscape(function(enabled){
        console.log('isCloseOnEscape', enabled); // logs as true
    });
}