close mobile keyboard when bottom sheet opens
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user