close mobile keyboard when bottom sheet opens

This commit is contained in:
2025-11-04 20:34:04 +03:00
parent 59745325ec
commit 2d2773aa13

View File

@@ -50,6 +50,22 @@ export function ProBottomSheet({
};
}, [isOpen]);
// Close mobile keyboard when bottom sheet opens
useEffect(() => {
if (isOpen) {
// Blur any active input element to close the mobile keyboard
const activeElement = document.activeElement as HTMLElement;
if (
activeElement &&
(activeElement.tagName === "INPUT" ||
activeElement.tagName === "TEXTAREA" ||
activeElement.isContentEditable)
) {
activeElement.blur();
}
}
}, [isOpen]);
// Event handlers
const startDrag = useCallback((clientY: number) => {
setIsDragging(true);