diff --git a/lib/gui/components/modal/services/modal.js b/lib/gui/components/modal/services/modal.js index 31927769..eba4da83 100644 --- a/lib/gui/components/modal/services/modal.js +++ b/lib/gui/components/modal/services/modal.js @@ -59,10 +59,15 @@ module.exports = function($uibModal, $q) { .then(resolve) .catch((error) => { + // Bootstrap doesn't 'resolve' these but cancels the dialog; + // therefore call 'resolve' here applied to 'false'. + if (error === 'escape key press' || error === 'backdrop click') { + resolve(false); + // For some annoying reason, UI Bootstrap Modal rejects // the result reason if the user clicks on the backdrop // (e.g: the area surrounding the modal). - if (error !== 'backdrop click') { + } else if (error !== 'backdrop click') { return reject(error); }