Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Fix: Mini Cart block button should be disabled in the editor (#5308)
Browse files Browse the repository at this point in the history
  • Loading branch information
dinhtungdu authored Dec 7, 2021
1 parent 986b3ce commit 22c77d3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
2 changes: 1 addition & 1 deletion assets/js/base/components/noninteractive/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const Noninteractive = ( {
style = {},
...props
}: {
children: React.ReactChildren;
children: React.ReactNode;
style?: Record< string, string >;
} ): JSX.Element => {
const node = useRef< HTMLDivElement >( null );
Expand Down
33 changes: 18 additions & 15 deletions assets/js/blocks/cart-checkout/mini-cart/edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { __ } from '@wordpress/i18n';
import { positionCenter, positionRight, positionLeft } from '@wordpress/icons';
import classnames from 'classnames';
import { isString } from '@woocommerce/types';
import Noninteractive from '@woocommerce/base-components/noninteractive';

/**
* Internal dependencies
Expand Down Expand Up @@ -165,22 +166,24 @@ const MiniCartBlock = ( {
</PanelBody>
) }
</InspectorControls>
<button
className={ classnames(
'wc-block-mini-cart__button',
colorClassNames
) }
style={ colorStyle }
>
<span className="wc-block-mini-cart__amount">
{ formatPrice( productTotal ) }
</span>
<QuantityBadge
count={ productCount }
colorClassNames={ colorClassNames }
<Noninteractive>
<button
className={ classnames(
'wc-block-mini-cart__button',
colorClassNames
) }
style={ colorStyle }
/>
</button>
>
<span className="wc-block-mini-cart__amount">
{ formatPrice( productTotal ) }
</span>
<QuantityBadge
count={ productCount }
colorClassNames={ colorClassNames }
style={ colorStyle }
/>
</button>
</Noninteractive>
<CartCheckoutCompatibilityNotice blockName="mini-cart" />
</div>
);
Expand Down

0 comments on commit 22c77d3

Please sign in to comment.