BUG: cover-view嵌套button在安卓手机中无法正确应用点击样式
发布于 5 年前 作者 yang59 12516 次浏览 来自 问答

- 当前 Bug 的表现(可附上截图)

当cover-view中嵌套一个或多个button组件时,指定的hover-class样式将无法正确在安卓手机中应用——这个样式目前可以在模拟器中正确应用到。

__
__


模拟器可以正确模拟这个效果

但是到了安卓手机上就不会应用,依旧保持了按钮的原始的样式配色。

因为没有iOS设备,所以不能确定iOS设备是否也会如此。

- 预期表现

__
__

在cover-view中嵌套的button组件设置了hover-class,点击按钮后应该应用hover-class指定的样式。

- 最简复现 Demo

通过以下两段代码复现这个问题,我在2台台式计算机1台笔记本电脑上都这样试过,应该不是开发工具的锅

index.wxml

<cover-view class=".cov">

<button class="btn" hover-class="btn_tap">Hello World!</button>

</cover-view>


<button class="btn" hover-class="btn_tap">Hello World!</button>

index.wxss

.cov {

height: 20vh;

background-color: red;

}


.btn {

color: white;

background-color: blue;

}


.btn_tap {

color: black;

background-color: azure;

}

- 我的安卓手机信息


{
  "screenWidth": 360,
  "errMsg": "getSystemInfo:ok",
  "locationEnabled": true,
  "statusBarHeight": 24,
  "pixelRatio": 3,
  "notificationAuthorized": true,
  "system": "Android 7.0",
  "cameraAuthorized": true,
  "windowWidth": 360,
  "deviceOrientation": "portrait",
  "bluetoothEnabled": false,
  "brand": "xiaomi",
  "version": "7.0",
  "screenHeight": 640,
  "fontSizeSetting": 16,
  "language": "zh_CN",
  "locationAuthorized": true,
  "wifiEnabled": true,
  "windowHeight": 568,
  "microphoneAuthorized": true,
  "model": "Redmi Note 4X",
  "platform": "android",
  "SDKVersion": "2.5.0"
}

======================================================================

代码片断已经上传,这里再说一个比较邪门的问题……

在手机扫码代码片断后,点击button的确变色了,但是样式变不回去了,即便设置了hover-stay-time={{70}}也不行……

另外我发现点击button的时候相当于判定点到了cover-view和button,这应该也是有问题吧……?

回到顶部