Skip to content

Commit

Permalink
fix(tabs): 修复右滑返回上一页触发滑动页面的 bug
Browse files Browse the repository at this point in the history
手势返回上一页的时候,判断下原点的位置,如果离屏幕左边的距离太近当做是滑动返回上一页
  • Loading branch information
shaodahong authored Mar 19, 2019
1 parent c387460 commit ae87341
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/tabs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export default class AtTabs extends AtComponent {
const moveDistance = touchMove - this._touchDot
const maxIndex = tabList.length

if (!this._isMoving && this._interval < MAX_INTERVAL) {
if (!this._isMoving && this._interval < MAX_INTERVAL && this._touchDot > 20) {
// 向左滑动
if (current + 1 < maxIndex && moveDistance <= -MIN_DISTANCE) {
this._isMoving = true
Expand Down

0 comments on commit ae87341

Please sign in to comment.