diff --git a/plugins/woocommerce-blocks/assets/js/base/components/tabs/index.js b/plugins/woocommerce-blocks/assets/js/base/components/tabs/index.js index 755d1f42e78..91a154be402 100644 --- a/plugins/woocommerce-blocks/assets/js/base/components/tabs/index.js +++ b/plugins/woocommerce-blocks/assets/js/base/components/tabs/index.js @@ -69,7 +69,8 @@ const Tabs = ( { tabId={ `${ instanceId }-${ name }` } className="wc-block-components-tabs__content" > - { content } + { tabState.selectedId === `${ instanceId }-${ name }` && + content } ) ) } diff --git a/plugins/woocommerce-blocks/assets/js/payment-method-extensions/payment-methods/stripe/credit-card/payment-method.js b/plugins/woocommerce-blocks/assets/js/payment-method-extensions/payment-methods/stripe/credit-card/payment-method.js index dc87c1f93c4..0a0c5b7ec53 100644 --- a/plugins/woocommerce-blocks/assets/js/payment-method-extensions/payment-methods/stripe/credit-card/payment-method.js +++ b/plugins/woocommerce-blocks/assets/js/payment-method-extensions/payment-methods/stripe/credit-card/payment-method.js @@ -7,7 +7,6 @@ import { useState } from '@wordpress/element'; /** * Internal dependencies */ -import { PAYMENT_METHOD_NAME } from './constants'; import { getStripeServerData } from '../stripe-utils'; import { useCheckoutSubscriptions } from './use-checkout-subscriptions'; import { InlineCard, CardElements } from './elements'; @@ -83,11 +82,11 @@ const CreditCardComponent = ( { export const StripeCreditCard = ( props ) => { const { locale } = getStripeServerData().button; - const { activePaymentMethod, stripe } = props; + const { stripe } = props; - return activePaymentMethod === PAYMENT_METHOD_NAME ? ( + return ( - ) : null; + ); };