b2nil / taro-ui-vue3

采用 Vue 3.0 重写的 Taro UI 组件库
https://b2nil.github.io/taro-ui-vue3/
MIT License
160 stars 51 forks source link

`AtFloatLayout` 组件滚动穿透问题。 #95

Closed NO-MAP closed 3 years ago

NO-MAP commented 3 years ago

问题描述

AtFloatLayout 使用的是 fixed 定位,存在着滚动穿透的问题。AtFloatLayout 组件上的滚动操作会影响层级下的视图。 当前源码中使用的是 e.stopPropagation() 进行阻止滚动,但是目前 taro 已经推出了 catchMove api。望尽快支持该api。

版本信息

1.0.0-alpha.20

涉及的平台

weapp

相关链接

https://taro-docs.jd.com/taro/blog/2020-12-15-taro-3-1-beta/#3-%E6%94%AF%E6%8C%81%E9%98%BB%E6%AD%A2%E5%B0%8F%E7%A8%8B%E5%BA%8F%E6%BB%91%E5%8A%A8%E7%A9%BF%E9%80%8F

b2nil commented 3 years ago

近期支持一下。 如果感兴趣,也欢迎 PR。

b2nil commented 3 years ago

目前看来,catchMove 在支付宝小程序中并不能有效阻止组件滚动穿透,而在 h5 中,e.stopPropagation() 也不能有效阻止滚动穿透。暂时只能根据 Taro 的推荐,监听浮层的开启状态,在浮层弹出时,给底层的父 view 添加以下样式阻止滚动:

{
  overflow: 'hidden',
  height: '100vh'
}

这样做的缺点是,无法保持底层的位置,浮层关闭后,底层会回到顶部。

微信小程序 catchMove 表现正常,v1.0.0-alpha.21 已修复滚动穿透问题。