Skip to content

Commit

Permalink
swiper: fix cannot scroll body when touching with one item
Browse files Browse the repository at this point in the history
  • Loading branch information
airyland committed Jan 4, 2018
1 parent 9be5f97 commit 3b1f71b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/components/swiper/metas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@ events:
en: fires after height is caculated
zh-CN: 高度获取后触发
changes:
next:
en:
- '[fix] fix cannot scroll body when touching with one item'
zh-CN:
- '[fix] 修复只有一个 item 时无法滚动页面的问题'
2.7.6:
en:
- '[enhance] stop moving width one item'
Expand Down
5 changes: 4 additions & 1 deletion src/components/swiper/swiper.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class Swiper {
}
me.touchmoveHandler = (e) => {
if (me.count === 1) {
return e.preventDefault()
return
}
me._move.x = e.changedTouches[0].pageX
me._move.y = e.changedTouches[0].pageY
Expand All @@ -171,6 +171,9 @@ class Swiper {
}

me.touchendHandler = (e) => {
if (me.count === 1) {
return
}
me._end.x = e.changedTouches[0].pageX
me._end.y = e.changedTouches[0].pageY

Expand Down

0 comments on commit 3b1f71b

Please sign in to comment.