File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -106,11 +106,22 @@ export const Mobile = ({
106106 const siteMetadata = useSiteMetadata ( )
107107 const getCloseAnimation = exit => ( isForceClose ? undefined : { exit} )
108108
109+ const handleSearchToggle = React . useCallback ( ( ) => {
110+ setMobileSearchOpen ( true )
111+ } , [ setMobileSearchOpen ] )
112+
109113 return (
110114 < >
111- < Button aria-label = "Search" aria-expanded = { isMobileSearchOpen } onClick = { ( ) => setMobileSearchOpen ( true ) } >
112- < SearchIcon />
113- </ Button >
115+ { ! isMobileSearchOpen && (
116+ < Button
117+ aria-label = "Search"
118+ aria-expanded = { isMobileSearchOpen }
119+ onClick = { handleSearchToggle }
120+ >
121+ < SearchIcon />
122+ </ Button >
123+ ) }
124+
114125 < AnimatePresence >
115126 { isMobileSearchOpen ? (
116127 < FocusOn returnFocus = { true } onEscapeKey = { ( ) => resetAndClose ( true ) } >
@@ -157,6 +168,8 @@ export const Mobile = ({
157168 borderRightWidth : 0 ,
158169 borderColor : 'border.muted' ,
159170 position : 'relative' ,
171+ bg : 'canvas.default' ,
172+ zIndex : 9999 ,
160173 } }
161174 >
162175 < motion . div
You can’t perform that action at this time.
0 commit comments