Skip to content

Commit

Permalink
Fix search keyboard accessibility with reposition in layout (#1386)
Browse files Browse the repository at this point in the history
* fix: search accessibility with new position in layout
  • Loading branch information
dmitrymatio committed Feb 16, 2023
1 parent 42f2043 commit 8f4df67
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,7 @@ const GlobalHeader = ({
}}
aria-label={showSearch ? "Close Search" : "Search"}
isQuiet
tabIndex="0"
css={css`
margin-right: var(--spectrum-global-dimension-size-200);
Expand All @@ -879,6 +880,7 @@ const GlobalHeader = ({
variant="primary"
href="/console"
id={"consoleId"}
tabIndex="0"
css={css`
@media screen and (max-width: ${MOBILE_SCREEN_WIDTH}) {
display: none;
Expand Down
35 changes: 18 additions & 17 deletions packages/gatsby-theme-aio/src/components/Layout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,24 @@ export default ({ children, pageContext, location }) => {
searchButtonId={searchButtonId}
/>
</div>
{hasSearch && loadSearchFrame && (
<iframe
id='searchIframe'
src={searchIFrameSource()}
tabIndex="0"
css={css`position: fixed;
top: var(--spectrum-global-dimension-size-800);
left: 0px;
right: 0px;
bottom: 0px;
background-color: transparent;
z-index: 10;
width: 100%;
height: 100%;
visibility: ${showSearch ? "visible" : "hidden"};`}
></iframe>
)}

<div
id={sideNavId}
hidden={!hasSideNav}
Expand Down Expand Up @@ -838,23 +856,6 @@ export default ({ children, pageContext, location }) => {
</div>
</div>

{hasSearch && loadSearchFrame && (
<iframe
id='searchIframe'
src={searchIFrameSource()}
css={css`position: fixed;
top: var(--spectrum-global-dimension-size-800);
left: 0px;
right: 0px;
bottom: 0px;
background-color: transparent;
z-index: 10;
width: 100%;
height: 100%;
visibility: ${showSearch ? "visible" : "hidden"};`}
></iframe>
)}

<div
css={css`
position: fixed;
Expand Down

0 comments on commit 8f4df67

Please sign in to comment.