fix(前端): 寻车/导航按钮禁止选中文字,长按才能进丢失模式
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
This commit is contained in:
@@ -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; /* 长按时系统拿不到文本节点,只能落到按钮本身 */
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user