Skip to content
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

[Bug Report] IndexBar 索引栏与overflow: auto;冲突 #4252

Closed
Odyssey166 opened this issue Jun 8, 2021 · 7 comments
Closed

[Bug Report] IndexBar 索引栏与overflow: auto;冲突 #4252

Odyssey166 opened this issue Jun 8, 2021 · 7 comments
Milestone

Comments

@Odyssey166
Copy link

设备

iPhone6s

VantWeapp 版本

1.6.1

基础库版本

2.14.0

请提供核心代码片段链接

https://gitee.com/odysseyzhang/codes/cog2f45twvh6a1s089lpk96

描述问题

“vant-weapp/#/index-bar基础用法
点击索引栏时,会自动跳转到对应的IndexAnchor锚点位置。”

问题是只要在wxss中将页面设置为overflow: auto; 之后再点击索引栏,则没有反应,即索引栏失效。
用微信开发者工具或者iPhone6s真机调试都是如此。
Vant的IndexBar 索引栏则不存在这个问题。

@nemo-shen
Copy link
Collaborator

尝试了下 v1.6.1 配合 v2.14.1 基础库 无法复现问题,提供的链接访问受限,能重新提供下吗

@Odyssey166
Copy link
Author

抱歉,我在码云没交费,所以“代码片段功能目前只支持私有”,访问受限。已转发到百度网盘,请查收!
链接:https://pan.baidu.com/s/1R8Al0G-sQVfyqH8UJ96-Fg
提取码:5mjv

@nemo-shen
Copy link
Collaborator

@Odyssey166

原因说明

由于 <IndexBar /> 内部是使用了 wx.pageScrollTo微信小程序官方文档的解释是 pageScrollTo 只是页面级的滚动

建议

如果是使用 <IndexBar /> 建议不要嵌套在滚动元素中使用,我们会更新 IndexBar 组件对应的文档,归类到常见问题

特性支持

后续会考虑 <IndexBar /> 组件支持在 <scroll-view /> 中使用,但目前暂时无法做到,因为这可能需要对基础库版本进行升级(>2.14.4)

@nemo-shen nemo-shen modified the milestones: 1.8.3, 1.8.4 Aug 31, 2021
@Odyssey166
Copy link
Author

谢谢您的耐心解答!至于您的建议:“如果是使用 建议不要嵌套在滚动元素中使用”,窃以为既然是索引,那就肯定不只是一屏内容,就必然需要滚动显示了......

@nemo-shen
Copy link
Collaborator

已在 v1.8.4 中更新常见问题

@waycowei
Copy link

waycowei commented Dec 27, 2021

特性支持

后续会考虑 组件支持在 中使用,但目前暂时无法做到,因为这可能需要对基础库版本进行升级(>2.14.4)

请问有计划吗
@nemo-shen

@huasio
Copy link

huasio commented Sep 21, 2022

已在 v1.8.4 中更新常见问题

这样就无法嵌套在弹出层了,这是一个很常见的需求,以弹出层的方式展示索引。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants