From 279a876f7db8afd146035d6d5b21d796d8b8bfc7 Mon Sep 17 00:00:00 2001 From: Prssanna Desai Date: Wed, 16 Sep 2020 11:45:20 +0530 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20scroll=20for=20rtl=20dire?= =?UTF-8?q?ction=20(#111)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/style.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/style.js b/src/style.js index fa090b2..535dd1b 100644 --- a/src/style.js +++ b/src/style.js @@ -48,9 +48,7 @@ export default class Style { this._settingHeaderPosition = true; requestAnimationFrame(() => { - const { scrollLeft, scrollWidth, clientWidth } = e.target; - - let left = this.options.direction === 'rtl' ? scrollWidth - clientWidth - scrollLeft : -scrollLeft; + const left = -e.target.scrollLeft; $.style(this.header, { transform: `translateX(${left}px)`