-
Notifications
You must be signed in to change notification settings - Fork 219
Fix: navigate through Mini Cart contents with keyboard #6731
Conversation
Size Change: +175 B (0%) Total Size: 873 kB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is testing well and code looks good, thanks for improving the styles of the buttons when hovered/focused as well. I left a comment with some thoughts about rewriting a small part of the code, but leaving the final decision to you. 👍
&:focus { | ||
box-shadow: 0 0 0 2px $studio-blue; | ||
box-shadow: inset 0 0 0 1px $white, 0 0 0 2px $studio-blue; | ||
outline: 3px solid transparent; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we could avoid repeating the styles from assets/js/base/components/button/style.scss
, something like this: https://github.com/woocommerce/woocommerce-blocks/compare/fix/6575...fix/6575-style-suggestion?expand=1.
I know it doesn't simplify the code much because we need to use :not()
in a couple of instances. But at the same time, it means the Mini Cart buttons are better aligned with the default styles, so I think it's probably a good thing in the long term.
Ideally, some day assets/js/base/components/button/style.scss
will use currentColor
instead of $gray-900
, so we will be able to just reuse the styles from there, but that requires adding global styles to the Cart and Checkout blocks, so it's outside of our control right now.
@Aljullu Thank you so much for your great suggestion! I applied it to this PR. |
The release ZIP for this PR is accessible via:
|
Fixes #6575
This PR fixes the keyboard navigation issue for the Mini Cart Contents inner blocks.
Accessibility
prefers-reduced-motion
Screenshots
I tested this PR against most popular desktop browsers:
Safari (needs to press Option + Tab to navigate to links)
Screen.Recording.2022-07-21.at.23.21.33.mov
Opera
Screen.Recording.2022-07-21.at.23.20.05.mov
Edge
Screen.Recording.2022-07-21.at.23.19.46.mov
Firefox (Need to adjust keyboard setting on macOS, see https://pointclearmedia.com/2020/01/03/how-to-fix-firefox-tabindex-not-working/)
Screen.Recording.2022-07-21.at.23.17.18.mov
Chrome
Screen.Recording.2022-07-21.at.23.15.01.mov
Testing
Automated Tests
User Facing Testing
WooCommerce Visibility
Changelog