From 3bb9bdcc3afdb044fb40333852a0ac015028bd8c Mon Sep 17 00:00:00 2001 From: gujiangjiang Date: Fri, 17 Oct 2025 05:41:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E5=BC=B9=E7=AA=97=E5=9C=A8=E7=A7=BB=E5=8A=A8=E7=AB=AF=E8=A7=86?= =?UTF-8?q?=E5=9B=BE=E4=B8=8B=E5=BC=82=E5=B8=B8=E6=98=BE=E7=A4=BA=E4=B8=94?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E5=85=B3=E9=97=AD=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/modal.tsx | 9 ++++++--- frontend/src/components/password.tsx | 2 ++ 2 files changed, 8 insertions(+), 3 deletions(-) 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()} />