From 822ace668a84b434a6d28e48a948eae1b47dfd1a Mon Sep 17 00:00:00 2001 From: Alexander Skvortsov Date: Fri, 25 Sep 2020 12:54:03 -0400 Subject: [PATCH] Prevent hide animation when opening modal from other modal --- framework/core/js/src/common/components/Modal.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/framework/core/js/src/common/components/Modal.js b/framework/core/js/src/common/components/Modal.js index 2a59beb01..b08f73b3a 100644 --- a/framework/core/js/src/common/components/Modal.js +++ b/framework/core/js/src/common/components/Modal.js @@ -27,8 +27,13 @@ export default class Modal extends Component { this.attrs.onshow(() => this.onready()); } - onremove() { - this.attrs.onhide(); + onbeforeremove() { + // If the global modal state currently contains a modal, + // we've just opened up a new one, and accordingly, + // we don't need to show a hide animation. + if (!app.modal.modal) { + this.attrs.onhide(); + } } view() { @@ -107,7 +112,7 @@ export default class Modal extends Component { * Hide the modal. */ hide() { - this.attrs.onhide(); + app.modal.close(); } /**