From 46366d50666bc4e8687bb74fcc1c26d698c83cc3 Mon Sep 17 00:00:00 2001 From: Rish Date: Fri, 16 Oct 2020 15:07:04 +0530 Subject: [PATCH] Fixed popup close in preview mode with Esc no refs - Popup shouldn't close with Esc in preview mode on Ghost Admin --- ghost/portal/src/components/PopupModal.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ghost/portal/src/components/PopupModal.js b/ghost/portal/src/components/PopupModal.js index 303d5b72a3..b245540dae 100644 --- a/ghost/portal/src/components/PopupModal.js +++ b/ghost/portal/src/components/PopupModal.js @@ -54,7 +54,7 @@ class PopupContent extends React.Component { componentDidMount() { // Handle Esc to close popup - if (this.node) { + if (this.node && !hasMode(['preview'])) { this.node.focus(); this.keyUphandler = (event) => { const eventTargetTag = (event.target && event.target.tagName); @@ -96,7 +96,7 @@ class PopupContent extends React.Component { render() { const {page, site} = this.context; const {portal_plans: portalPlans} = site; - const {is_stripe_configured: isStripeConfigured, + const {is_stripe_configured: isStripeConfigured, allow_self_signup: allowSelfSignup} = site; getActivePage({page});