From 4f9f0475cd4d4b7dd07b948c303e42008124805c Mon Sep 17 00:00:00 2001 From: Ali Al Dubaisi Date: Fri, 18 Jun 2021 00:44:20 +0300 Subject: [PATCH 1/3] Fix navigation in pre-paginated RTL double page view --- src/managers/default/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/managers/default/index.js b/src/managers/default/index.js index b24a4f66a..d3cf95d0d 100644 --- a/src/managers/default/index.js +++ b/src/managers/default/index.js @@ -476,7 +476,7 @@ class DefaultViewManager { next = this.views.last().section.next(); } } else { - left = this.container.scrollLeft + ( this.layout.delta * -1 ); + left = this.container.scrollLeft - this.container.offsetWidth; if (left > this.container.scrollWidth * -1){ this.scrollBy(this.layout.delta, 0, true); From ee1c76f913916abbcbcb5215e479f0b3f0125b33 Mon Sep 17 00:00:00 2001 From: Ali Al Dubaisi Date: Fri, 18 Jun 2021 16:19:05 +0300 Subject: [PATCH 2/3] RTL navigation fix in continuous mode --- src/managers/continuous/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/managers/continuous/index.js b/src/managers/continuous/index.js index e6a9e619b..98dcf5a3f 100644 --- a/src/managers/continuous/index.js +++ b/src/managers/continuous/index.js @@ -379,10 +379,10 @@ class ContinuousViewManager extends DefaultViewManager { this.scrollTo(0, prevTop - bounds.height, true); } else { if(this.settings.direction === 'rtl') { - if (!this.settings.fullsize) { - this.scrollTo(prevLeft, 0, true); - } else { + if (this.settings.rtlScrollType === "negative") { this.scrollTo(prevLeft + Math.floor(bounds.width), 0, true); + } else { + this.scrollTo(prevLeft, 0, true); } } else { this.scrollTo(prevLeft - Math.floor(bounds.width), 0, true); From ce8a4aaf7aaa5a1849f75e3b88d3a33b46b7c917 Mon Sep 17 00:00:00 2001 From: Ali Al Dubaisi Date: Tue, 22 Jun 2021 18:01:05 +0300 Subject: [PATCH 3/3] Limiting logic to RTL with negative scroll type --- src/managers/default/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/managers/default/index.js b/src/managers/default/index.js index d3cf95d0d..71579a4b9 100644 --- a/src/managers/default/index.js +++ b/src/managers/default/index.js @@ -352,14 +352,14 @@ class DefaultViewManager { distY = this.container.scrollHeight - this.layout.delta; } } - if(this.settings.direction === 'rtl'){ + if(this.settings.direction === 'rtl' && this.settings.rtlScrollType === 'negative'){ /*** the `floor` function above (L343) is on positive values, so we should add one `layout.delta` to distX or use `Math.ceil` function, or multiply offset.left by -1 before `Math.floor` */ - distX = distX + this.layout.delta - distX = distX - width + distX = distX + this.layout.delta; + distX = distX - width; } this.scrollTo(distX, distY, true); }