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

Fix: navigate through Mini Cart contents with keyboard #6731

Merged
merged 2 commits into from
Jul 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion assets/js/base/components/button/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,12 @@

&.outlined {
background-color: transparent;
box-shadow: inset 0 0 0 1px $gray-900;
color: $gray-900;

&:not(:focus) {
box-shadow: inset 0 0 0 1px $gray-900;
}

&:disabled,
&:hover,
&:focus,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ const Block = ( {
className,
}: MiniCartItemsBlockProps ): JSX.Element => {
return (
<div className={ classNames( className, 'wc-block-mini-cart__items' ) }>
<div
className={ classNames( className, 'wc-block-mini-cart__items' ) }
tabIndex={ -1 }
>
{ children }
</div>
);
Expand Down
24 changes: 15 additions & 9 deletions assets/js/blocks/mini-cart/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -142,22 +142,28 @@ h2.wc-block-mini-cart__title {
display: flex;
gap: $gap;

.wc-block-mini-cart__footer-cart.wc-block-components-button {
box-shadow: inset 0 0 0 1px currentColor;
color: currentColor;
display: none;
.wc-block-components-button {
flex-grow: 1;
font-weight: 600;
}

.wc-block-components-button.outlined {
color: currentColor;
display: none;

&:not(:focus) {
box-shadow: inset 0 0 0 1px currentColor;
}

&:hover,
&:focus {
color: $white;
}

@media only screen and (min-width: 480px) {
display: inline-flex;
}
}

.wc-block-mini-cart__footer-checkout {
flex-grow: 1;
font-weight: 600;
}
}

.wc-block-components-payment-method-icons {
Expand Down
4 changes: 2 additions & 2 deletions src/BlockTypes/MiniCartContents.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ protected function enqueue_assets( array $attributes ) {
'.wc-block-mini-cart__footer .wc-block-mini-cart__footer-actions .wc-block-mini-cart__footer-checkout',
'.wc-block-mini-cart__footer .wc-block-mini-cart__footer-actions .wc-block-mini-cart__footer-checkout:hover',
'.wc-block-mini-cart__footer .wc-block-mini-cart__footer-actions .wc-block-mini-cart__footer-checkout:focus',
'.wc-block-mini-cart__footer .wc-block-mini-cart__footer-actions .wc-block-mini-cart__footer-cart:hover',
'.wc-block-mini-cart__footer .wc-block-mini-cart__footer-actions .wc-block-mini-cart__footer-cart:focus',
'.wc-block-mini-cart__footer .wc-block-mini-cart__footer-actions .wc-block-mini-cart__footer-cart.wc-block-components-button:hover',
'.wc-block-mini-cart__footer .wc-block-mini-cart__footer-actions .wc-block-mini-cart__footer-cart.wc-block-components-button:focus',
'.wc-block-mini-cart__shopping-button a:hover',
'.wc-block-mini-cart__shopping-button a:focus',
),
Expand Down