From 95b2f95452eb359cca0102ff3458f825108e75c6 Mon Sep 17 00:00:00 2001 From: NekoYume517 <3146527494@qq.com> Date: Mon, 16 Nov 2026 13:09:26 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=89=8D=E7=AB=AF):=20=E5=AF=BB=E8=BD=A6/?= =?UTF-8?q?=E5=AF=BC=E8=88=AA=E6=8C=89=E9=92=AE=E7=A6=81=E6=AD=A2=E9=80=89?= =?UTF-8?q?=E4=B8=AD=E6=96=87=E5=AD=97=EF=BC=8C=E9=95=BF=E6=8C=89=E6=89=8D?= =?UTF-8?q?=E8=83=BD=E8=BF=9B=E4=B8=A2=E5=A4=B1=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit iOS 上长按按钮会先触发系统文本选择(弹「拷贝/查询」),正文被选中后 touchstart 长按计时器收不到,丢失模式进不去。给卡片顶部按钮加: - user-select: none(含 -webkit/-moz/-ms 前缀) - -webkit-touch-callout: none → iOS 长按不弹系统菜单 - -webkit-tap-highlight-color: transparent - touch-action: manipulation - 子元素(图标/文字 span)pointer-events: none + user-select: none, 长按时系统拿不到文本节点,只能落到按钮本身 实测(390px):按钮 computed userSelect=none、touchAction=manipulation、 span pointerEvents=none;点击仍正常触发 /api/find_bike;JS 异常 0 --- static/css/map.css | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/static/css/map.css b/static/css/map.css index 0de836d..9f58a22 100644 --- a/static/css/map.css +++ b/static/css/map.css @@ -2896,3 +2896,28 @@ 0%, 100% { box-shadow: 0 6px 18px rgba(179, 38, 30, .35); } 50% { box-shadow: 0 6px 26px rgba(179, 38, 30, .65); } } + +/* 卡片顶部按钮(寻车 / 导航 / 关闭):长按要能进丢失模式,不能被系统当成“选中文字”。 + iOS 上除了 user-select,还要关掉 touch-callout(否则长按会弹「拷贝/查询」菜单), + 安卓上关掉 tap-highlight 避免长按出现灰块。 */ +.bike-card-header-btns .bike-card-find-btn, +.bike-card-header-btns .bike-card-close, +#bike-find-btn-header, +#bike-nav-btn { + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + -webkit-touch-callout: none; + -webkit-tap-highlight-color: transparent; + touch-action: manipulation; +} +/* 子元素(图标 / 文字 span)继承不到没关系,显式再来一遍 */ +.bike-card-header-btns .bike-card-find-btn *, +#bike-find-btn-header *, +#bike-nav-btn * { + -webkit-user-select: none; + user-select: none; + -webkit-touch-callout: none; + pointer-events: none; /* 长按时系统拿不到文本节点,只能落到按钮本身 */ +}