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 = ({
106
106
const siteMetadata = useSiteMetadata ( )
107
107
const getCloseAnimation = exit => ( isForceClose ? undefined : { exit} )
108
108
109
+ const handleSearchToggle = React . useCallback ( ( ) => {
110
+ setMobileSearchOpen ( true )
111
+ } , [ setMobileSearchOpen ] )
112
+
109
113
return (
110
114
< >
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
+
114
125
< AnimatePresence >
115
126
{ isMobileSearchOpen ? (
116
127
< FocusOn returnFocus = { true } onEscapeKey = { ( ) => resetAndClose ( true ) } >
@@ -157,6 +168,8 @@ export const Mobile = ({
157
168
borderRightWidth : 0 ,
158
169
borderColor : 'border.muted' ,
159
170
position : 'relative' ,
171
+ bg : 'canvas.default' ,
172
+ zIndex : 9999 ,
160
173
} }
161
174
>
162
175
< motion . div
You can’t perform that action at this time.
0 commit comments