From 492d47cb85ecb1cb9b6bf9275d996573ad497ea3 Mon Sep 17 00:00:00 2001 From: George Mendoza Date: Wed, 22 Feb 2023 12:03:46 +0800 Subject: [PATCH] Do not allow buttons in disabled payment-step to be clickable. This is a workaround. Note that it's still possible to trigger the PayPal button iframe by tabbing to it and hitting enter. The hack works for the Venmo and PayPal buttons. The Apple Pay Button is also not yet tested as of this commit. It will be tested in https://github.com/solidusio/solidus_braintree/issues/105. --- .../stylesheets/spree/frontend/solidus_braintree.scss | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/assets/stylesheets/spree/frontend/solidus_braintree.scss b/app/assets/stylesheets/spree/frontend/solidus_braintree.scss index d69bb4e3..f1c30029 100644 --- a/app/assets/stylesheets/spree/frontend/solidus_braintree.scss +++ b/app/assets/stylesheets/spree/frontend/solidus_braintree.scss @@ -49,3 +49,14 @@ the installer will append this file to the app vendored assets here: 'vendor/ass .venmo-button.visible { visibility: visible; } + +/* +WORKAROUND: Do not allow buttons in disabled payment-step to be clickable. Note +that it's still possible to trigger the PayPal button iframe by tabbing to it +and hitting enter. +*/ +fieldset.payment-step__details:disabled { + #apple-pay-button, #paypal-button iframe, #venmo-button { + pointer-events: none; + } +}