fix(FN-1207): improve mobile header search behavior
- Replace delayed focus effect with native autoFocus on the mobile search input - Constrain expanded mobile search positioning and width to prevent overflow on small viewports - Add Header tests covering mobile search auto-focus and expanded container rendering
This commit is contained in:
@@ -195,13 +195,6 @@ export function Header({
|
||||
return () => document.removeEventListener("keydown", handleKeyDown);
|
||||
}, []);
|
||||
|
||||
// Focus input when mobile search opens
|
||||
useEffect(() => {
|
||||
if (isMobileSearchOpen && mobileSearchInputRef.current) {
|
||||
setTimeout(() => mobileSearchInputRef.current?.focus(), 0);
|
||||
}
|
||||
}, [isMobileSearchOpen]);
|
||||
|
||||
const handleMobileSearchToggle = useCallback(() => {
|
||||
setIsMobileSearchOpen((prev) => !prev);
|
||||
}, []);
|
||||
@@ -335,6 +328,7 @@ export function Header({
|
||||
<Search size={14} className="header-search-icon" />
|
||||
<input
|
||||
ref={mobileSearchInputRef}
|
||||
autoFocus
|
||||
type="text"
|
||||
placeholder="Search tasks..."
|
||||
value={searchQuery}
|
||||
|
||||
Reference in New Issue
Block a user