react-weui icon indicating copy to clipboard operation
react-weui copied to clipboard

Fix swiper `TouchMove` to normal page scrolling caused by `preventDef…

Open dawiwt opened this issue 6 years ago • 1 comments

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

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

dawiwt avatar May 09 '19 08:05 dawiwt

Coverage Status

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

coveralls avatar May 09 '19 08:05 coveralls