Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix swiper TouchMove to normal page scrolling caused by `preventDef... #298

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

Open
dawiwt wants to merge 1 commit into weui:master
base: master
Choose a base branch
Loading
from dawiwt:master

Conversation

@dawiwt
Copy link

@dawiwt dawiwt commented May 9, 2019

修复 Swiper handleTouchMove 事件中的 preventDefault 导致页面不能正常滚动的问题。

  1. 在 handleTouchStart 记录起始触摸点
  2. 在 handleTouchMove 中计算横向与纵向触摸移动距离
  3. 分别比较横向与纵向移动距离来判断用户滚动意向,满足当前 direction 才对 diff 求值
  4. 比较 diff 与 translate 来决定是否 preventDefault 并且更新 translate

Copy link

Coverage Status

Coverage decreased (-0.5%) to 81.029% when pulling 26bda65 on dawiwt:master into f8b12cd on weui:master.

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

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /