fix: keyboard should be hidden always on input blur (#446)
This commit is contained in:
parent
f4769b62ef
commit
2761afb190
1 changed files with 7 additions and 0 deletions
|
|
@ -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]);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue