Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RTL fixes #1201

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/managers/continuous/index.js
Expand Up @@ -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);
Expand Down
8 changes: 4 additions & 4 deletions src/managers/default/index.js
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
Expand Down