From 5304cecbae1eeb755c8f09d0cc36526b496e9596 Mon Sep 17 00:00:00 2001 From: tjmtmmnk Date: Fri, 10 Jun 2022 17:59:41 +0900 Subject: [PATCH] align with offset of next/prev --- src/managers/default/index.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/managers/default/index.js b/src/managers/default/index.js index 2812d87..a3a6e59 100644 --- a/src/managers/default/index.js +++ b/src/managers/default/index.js @@ -350,10 +350,9 @@ class DefaultViewManager { distX = this.container.scrollWidth - this.layout.delta; } - distY = Math.floor(offset.top / this.layout.delta) * this.layout.delta; - - if (distY + this.layout.delta > this.container.scrollHeight) { - distY = this.container.scrollHeight - this.layout.delta; + distY = Math.floor(offset.top / this.layout.height) * this.layout.height; + if (distY + this.layout.height > this.container.scrollHeight) { + distY = this.container.scrollHeight - this.layout.height; } } if(this.settings.direction === 'rtl'){