diff --git a/package.json b/package.json index 94a45a7..442e5f5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "uxcore-table", - "version": "9.3.0", + "version": "9.3.1", "description": "table ui component for react", "repository": "https://github.com/uxcore/uxcore-table.git", "author": "zhouquan.yezq", diff --git a/src/Table.jsx b/src/Table.jsx index cd4fa11..127ecdd 100644 --- a/src/Table.jsx +++ b/src/Table.jsx @@ -360,9 +360,12 @@ class Table extends React.Component { const fixedColumnsWidth = this.headerFixed.getFixedColumnsWidth(); if (fixedColumnsWidth && fixedColumnsWidth !== this.fixedColumnsWidth) { this.fixedColumnsWidth = fixedColumnsWidth; - this.mainTable.style.position = 'relative'; - this.mainTable.style.left = `${leftFixedMaxWidth - fixedColumnsWidth}px`; - this.mainTable.style.width = `calc(100% + ${fixedColumnsWidth - leftFixedMaxWidth}px)`; + const offset = leftFixedMaxWidth - fixedColumnsWidth; + if (offset < 0) { + this.mainTable.style.position = 'relative'; + this.mainTable.style.left = `${offset}px`; + this.mainTable.style.width = `calc(100% + ${-offset}px)`; + } } } diff --git a/src/Tbody.jsx b/src/Tbody.jsx index cca6cce..c7c4bc1 100644 --- a/src/Tbody.jsx +++ b/src/Tbody.jsx @@ -194,7 +194,7 @@ class Tbody extends React.Component { if (props.leftFixedMaxWidth) { style = { ...style, - overflowX: 'scroll', + overflowX: 'auto', }; } bodyWrapClassName = 'kuma-uxtable-body-fixed';