From 909bd60db3a733ac33029fa04aa9313bf937b248 Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Fri, 18 Jun 2021 10:12:36 +0100 Subject: [PATCH] Fixed errors when enter key is pressed in modals no issue - enter key when a modal is displayed will always trigger the `confirm` action, if it's not provided then the base modal will throw a `You must override the "confirm" action ...` error --- .../components/modal-impersonate-member.js | 5 +++ .../app/components/modal-markdown-help.js | 4 ++ .../app/components/modal-member-product.hbs | 15 +++---- .../app/components/modal-member-product.js | 39 +++++++------------ .../components/modal-members-label-form.js | 5 +++ .../components/modal-post-email-preview.js | 5 ++- .../app/components/modal-regenerate-key.js | 5 +++ .../app/components/modal-stripe-connect.hbs | 2 +- .../app/components/modal-stripe-connect.js | 10 +++++ .../app/components/modal-theme-warnings.js | 8 +++- ...-upgrade-custom-integrations-host-limit.js | 6 ++- .../modal-upgrade-host-limit-custom-theme.js | 6 ++- .../components/modal-upgrade-host-limit.js | 7 +++- ...modal-upgrade-unsuspend-user-host-limit.js | 6 ++- ghost/admin/app/components/modal-whats-new.js | 7 +++- 15 files changed, 90 insertions(+), 40 deletions(-) diff --git a/ghost/admin/app/components/modal-impersonate-member.js b/ghost/admin/app/components/modal-impersonate-member.js index b52823c587..4e301a0fd0 100644 --- a/ghost/admin/app/components/modal-impersonate-member.js +++ b/ghost/admin/app/components/modal-impersonate-member.js @@ -19,6 +19,11 @@ export default ModalComponent.extend({ this._signinUrlUpdateTask.perform(); }, + actions: { + // noop - we don't want the enter key doing anything + confirm() {} + }, + copySigninUrl: task(function* () { copyTextToClipboard(this.get('signinUrl')); yield timeout(1000); diff --git a/ghost/admin/app/components/modal-markdown-help.js b/ghost/admin/app/components/modal-markdown-help.js index e083ba9a3c..2ccb30a971 100644 --- a/ghost/admin/app/components/modal-markdown-help.js +++ b/ghost/admin/app/components/modal-markdown-help.js @@ -1,4 +1,8 @@ import ModalComponent from 'ghost-admin/components/modal-base'; export default ModalComponent.extend({ + actions: { + // noop - we don't want the enter key doing anything + confirm() {} + } }); diff --git a/ghost/admin/app/components/modal-member-product.hbs b/ghost/admin/app/components/modal-member-product.hbs index 40bfffaf4e..01e83f8664 100644 --- a/ghost/admin/app/components/modal-member-product.hbs +++ b/ghost/admin/app/components/modal-member-product.hbs @@ -1,14 +1,16 @@ -{{svg-jar - "close"}} + + {{svg-jar "close"}} +