-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[A11y] [Header] Fix search bar element focus order (@W-12627142@) #1969
Conversation
@@ -318,6 +339,9 @@ const Header = ({ | |||
{...styles.icons} | |||
onClick={onMyCartClick} | |||
/> | |||
<HideOnDesktop display={{base: 'contents', lg: 'none'}}> |
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.
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.
That's the expected behavior on the desktop screen. Check the styles used on mobile, and you'll see display: contents
on mobile.
*/ | ||
export const HideOnDesktop = ({children}) => ( | ||
<Box display={{base: 'block', lg: 'none'}}>{children}</Box> | ||
export const HideOnDesktop = ({children, display = {base: 'block', lg: 'none'}}) => ( |
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.
If we want to make it more general, we can have the user override any props. Something like this:
export const HideOnDesktop = ({children, ...rest}) => (
<Box display={{base: 'block', lg: 'none'}} {...rest}>
{children}
</Box>
)
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.
Just comments re: the prop types.
Description
Redo of PR #1910 with an isomorphic solution.
Fixes the search bar element in the header to the correct keyboard focus order for Desktop and Mobile, left to right and top to bottom.
Types of Changes
Changes
How to Test-Drive This PR
a11y-header-order-focus-ssr
and start the retail react appnpm start
Checklists
General
Accessibility Compliance
You must check off all items in one of the follow two lists:
or...
Localization