diff --git a/frontend/src/components/modal.tsx b/frontend/src/components/modal.tsx index 6a5d1d9..7f1107a 100644 --- a/frontend/src/components/modal.tsx +++ b/frontend/src/components/modal.tsx @@ -44,12 +44,15 @@ export function Modal({ return () => document.removeEventListener("keydown", onKeyDown); }, [onKeyDown]); + // 修复:在移动端,只有当 showModal 为 true 时才渲染 Leaflet 组件。 + // 这可以防止它在所有页面加载时都默认弹出。 + // 同时,添加 showBlur={true} 属性以显示背景遮罩。 if (isMobile) { - return ( - + return showModal ? ( + {children} - ); + ) : null; } return ( diff --git a/frontend/src/components/password.tsx b/frontend/src/components/password.tsx index 1e7eb07..0bf7e7a 100644 --- a/frontend/src/components/password.tsx +++ b/frontend/src/components/password.tsx @@ -42,9 +42,11 @@ export default function PasswordModal({ return (
+ {/* 修复:添加 onPointerDown 事件来阻止拖动事件与点击事件的冲突 */} setShowPasswordModal(false)} + onPointerDown={(e) => e.stopPropagation()} />