Modal dismiss not firing on escape key

I open a Modal and hit the escape key ( in browser ).
dismiss() is not called and no data is returned to the onDidDismiss function. It is called but with no data.
Example below:

let profileModal = this.modalCtrl.create(ModalPage, { time: 30 });
      profileModal.onDidDismiss(data => {
        console.log('modal data sent to main form', data)


    console.log("Modal Page Dismiss")
    let data = { 'time': '60' };

I can however pass the data from the modal to the onDidDismiss by using:

    console.log("ON MODAL ionViewDidLeave")
    let data = { 'time': 60 };

But I get this error:
ERROR Error: Uncaught (in promise): removeView was not found
because it is trying to dismiss a Modal that was alraedy dismissed by the Escape key.

If I add a button to the Modal and call this:

let data = { 'time': 60 };

It works fine. This is strictly about catching the Escape dismiss and apssing data back to onDidDismiss()

1 Like

happening with me also, this is really annoying