1
0
mirror of synced 2025-12-22 03:16:52 -05:00

Fixing mobile search header (#34326)

This commit is contained in:
Grace Park
2023-02-01 10:21:18 -08:00
committed by GitHub
parent 6b375939f3
commit 302b3a0663
2 changed files with 9 additions and 9 deletions

View File

@@ -63,13 +63,10 @@ export const Header = () => {
return () => window.removeEventListener('keydown', close)
}, [])
// For the UI in smaller browswer widths, focus the search input when the
// search input is opened and focus the picker menu button when the search
// For the UI in smaller browswer widths, and focus the picker menu button when the search
// input is closed.
useEffect(() => {
if (isSearchOpen) {
document.querySelector<HTMLInputElement>('input[type="search"]')?.focus()
} else if (!isSearchOpen && isMounted.current && menuButtonRef.current) {
if (!isSearchOpen && isMounted.current && menuButtonRef.current) {
menuButtonRef.current.focus()
}
@@ -175,7 +172,6 @@ export const Header = () => {
{/* The ... navigation menu at medium and smaller widths */}
<nav>
<AnchoredOverlay
anchorRef={menuButtonRef}
renderAnchor={(anchorProps) => (
<IconButton
data-testid="mobile-menu"