Skip to content

Commit 3541b8b

Browse files
authored
Merge pull request #459 from didi/dev
fix(scroll): nested scroll bug
2 parents 2a6ae4a + a177a98 commit 3541b8b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/components/scroll/scroll.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,12 +386,18 @@
386386
const reachBoundaryX = distX > 0 ? pos.x >= this.scroll.minScrollX : distX < 0 ? pos.x <= this.scroll.maxScrollX : false
387387
const reachBoundaryY = distY > 0 ? pos.y >= this.scroll.minScrollY : distY < 0 ? pos.y <= this.scroll.maxScrollY : false
388388
const freeScroll = this.scroll.freeScroll
389+
const hasHorizontalScroll = this.scroll.hasHorizontalScroll
390+
const hasVerticalScroll = this.scroll.hasVerticalScroll
391+
392+
if (!hasHorizontalScroll && !hasVerticalScroll) {
393+
return true
394+
}
389395
390-
let reachBoundary
391396
if (freeScroll) {
392397
return reachBoundaryX || reachBoundaryY
393398
}
394399
400+
let reachBoundary
395401
if (this.scroll.movingDirectionX) {
396402
reachBoundary = reachBoundaryX
397403
} else if (this.scroll.movingDirectionY) {

0 commit comments

Comments
 (0)