fix: keyboard should be hidden always on input blur (#446)

This commit is contained in:
David Leibovych 2025-10-23 21:31:49 +03:00 committed by GitHub
parent f4769b62ef
commit 2761afb190
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -72,11 +72,18 @@ const UniversalSearch: React.FC = () => {
} else {
// Re-enable body scroll
document.body.style.overflow = '';
// Hide soft keyboard on mobile when modal closes
if (window.innerWidth < 768 && inputRef.current) {
inputRef.current.blur();
}
}
// Cleanup function to ensure scroll is re-enabled when component unmounts
return () => {
document.body.style.overflow = '';
if (inputRef.current) {
inputRef.current.blur();
}
};
}, [isOpen, isMobileSearchOpen]);