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

slide嵌套scroll后内外层滚动相互影响 #649

Open
comDotCyx opened this issue Dec 4, 2019 · 3 comments
Open

slide嵌套scroll后内外层滚动相互影响 #649

comDotCyx opened this issue Dec 4, 2019 · 3 comments
Assignees

Comments

@comDotCyx
Copy link

Version

1.12.34

Reproduction link

https://codesandbox.io/s/vue-template-9btuy

Steps to reproduce

1 最外层是slide
2 每个slide里面使用纵向的scroll做下拉刷新和加载更多
3 某个slide里纵向的scroll又嵌套了一个横向的scroll(或者slide)

What is expected?

最里层横向的scroll横向滚动不会带动最外层slide滚动,但是纵向可以带动中间的scroll滚动

What is actually happening?

1 最里面的scroll使用options.stopPropagation:true导致纵向不能带动中间的scroll滚动,添加options.eventpassthrough:'vertical'也不行。
2 最里面的scroll使用options.stopPropagation:false(默认),则里面不能滚动,滑动的时候会拖动最外面的slide

Dependencies Version

vue: 2.6.9
better-scroll: 1.15.0


能否达到,最里层scroll只阻止横向冒泡,不阻止纵向冒泡的效果

@tank0317
Copy link
Collaborator

tank0317 commented Dec 6, 2019

目前还做不到。之后会支持。

@comDotCyx
Copy link
Author

@tank0317 谢谢,非常期待!

@itcql
Copy link

itcql commented Nov 16, 2021

可通过在纵向的scroll嵌套的横向的scroll(或者slide)添加touch事件解决这个问题,在touchstart时设置最外层Slide的scrollX = false,touchend时,设置最外层Slide的scrollX = true,然后refresh最外层slide

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

No branches or pull requests

3 participants