-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
父容器使用wx:if或者hidden,sticky粘性布局就会失效,文档里面没有写,这是正常情况还是bug? #5470
Comments
父元素不渲染理论上子元素的也不会渲染的,sticky自然无效。 |
是使用了wx:if,元素经过判断后渲染出来了 |
wx:if={{false}} sticky 还出来了? |
不是啊,因为有两个盒子,每个盒子里面都有一个van-sticky 组件,我用wx:if控制不同条件下,只展示其中一个盒子,展示出来的里面的sticky 是失效的 |
https://developers.weixin.qq.com/s/iFje0smc7iJn |
看了一下 除了hidden的时候有问题外 其他都是正常吸顶的 |
该issue 在vant-weapp2.0 解决。 |
重现链接
<view style="height: 10000px;"> <view style="background-color: aqua;height: 100px;"></view> <view wx:if="{{show}}"> <van-sticky> <button>按钮</button> </van-sticky> </view> </view>
Vant Weapp 版本
1.10.20
描述一下你遇到的问题。
Sticky粘性布局会失效
重现步骤
父容器使用wx:if判断的时候,Sticky直接失效,父容器使用hidden的时候,初始加载完成的时候元素直接就在最顶部,这种情况是设定如此吗?能不能解决
设备/浏览器
No response
The text was updated successfully, but these errors were encountered: