Comparing version
@@ -69,7 +69,7 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
var left = refState.current.x + event.pageX - refState.current.x - refState.current.delta; | ||
var isLTR = direction === "ltr"; | ||
var isRTL = direction === 'rtl'; | ||
// Limit scroll range | ||
left = Math.max(isLTR ? 0 : -bodyWidth + scrollBarWidth, Math.min(isLTR ? bodyWidth - scrollBarWidth : 0, left)); | ||
left = Math.max(isRTL ? scrollBarWidth - bodyWidth : 0, Math.min(isRTL ? 0 : bodyWidth - scrollBarWidth, left)); | ||
// Calculate the scroll position and update | ||
var shouldScroll = isLTR || Math.abs(left) + Math.abs(scrollBarWidth) < bodyWidth; | ||
var shouldScroll = !isRTL || Math.abs(left) + Math.abs(scrollBarWidth) < bodyWidth; | ||
if (shouldScroll) { | ||
@@ -76,0 +76,0 @@ onScroll({ |
@@ -79,7 +79,7 @@ "use strict"; | ||
var left = refState.current.x + event.pageX - refState.current.x - refState.current.delta; | ||
var isLTR = direction === "ltr"; | ||
var isRTL = direction === 'rtl'; | ||
// Limit scroll range | ||
left = Math.max(isLTR ? 0 : -bodyWidth + scrollBarWidth, Math.min(isLTR ? bodyWidth - scrollBarWidth : 0, left)); | ||
left = Math.max(isRTL ? scrollBarWidth - bodyWidth : 0, Math.min(isRTL ? 0 : bodyWidth - scrollBarWidth, left)); | ||
// Calculate the scroll position and update | ||
var shouldScroll = isLTR || Math.abs(left) + Math.abs(scrollBarWidth) < bodyWidth; | ||
var shouldScroll = !isRTL || Math.abs(left) + Math.abs(scrollBarWidth) < bodyWidth; | ||
if (shouldScroll) { | ||
@@ -86,0 +86,0 @@ onScroll({ |
{ | ||
"name": "rc-table", | ||
"version": "7.50.0", | ||
"version": "7.50.1", | ||
"description": "table ui component for react", | ||
@@ -5,0 +5,0 @@ "engines": { |