Skip to content

fix(docs): prevent search overlay overlapping branding on mobile Closes #1660 #1661

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 10, 2025
Merged
Changes from 1 commit
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
Next Next commit
fix(docs): prevent search overlay overlapping branding on mobile Closes
  • Loading branch information
Mohit5Upadhyay committed Jul 9, 2025
commit 50eda049bf932f72b48a4027a5208a6dce049db5
19 changes: 16 additions & 3 deletions src/components/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,22 @@ export const Mobile = ({
const siteMetadata = useSiteMetadata()
const getCloseAnimation = exit => (isForceClose ? undefined : {exit})

const handleSearchToggle = React.useCallback(() => {
setMobileSearchOpen(true)
}, [setMobileSearchOpen])

return (
<>
<Button aria-label="Search" aria-expanded={isMobileSearchOpen} onClick={() => setMobileSearchOpen(true)}>
<SearchIcon />
</Button>
{!isMobileSearchOpen && (
<Button
aria-label="Search"
aria-expanded={isMobileSearchOpen}
onClick={handleSearchToggle}
>
<SearchIcon />
</Button>
)}

<AnimatePresence>
{isMobileSearchOpen ? (
<FocusOn returnFocus={true} onEscapeKey={() => resetAndClose(true)}>
Expand Down Expand Up @@ -157,6 +168,8 @@ export const Mobile = ({
borderRightWidth: 0,
borderColor: 'border.muted',
position: 'relative',
bg: 'canvas.default',
zIndex: 9999,
}}
>
<motion.div
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy