diff --git a/build/Table.js b/build/Table.js index 95b7418..f6d3b41 100644 --- a/build/Table.js +++ b/build/Table.js @@ -514,7 +514,7 @@ var Table = function (_Component) { this.isShowScrollY(); if (this.bodyTable) { var currentOverflowX = window.getComputedStyle(this.bodyTable).overflowX; - if ((!this.props.scroll.x || this.props.scroll.x === '100%') && currentOverflowX === 'scroll') { + if ((!this.props.scroll.x || this.props.scroll.x === '100%') && currentOverflowX !== 'hidden') { this.bodyTable.style.overflowX = 'hidden'; } if (this.props.scroll.x && this.props.scroll.x !== '100%' && currentOverflowX !== 'scroll') { @@ -1229,6 +1229,8 @@ var Table = function (_Component) { innerBodyStyle.overflowY = bodyStyle.overflowY || 'scroll'; if (scroll.x && scroll.x !== '100%') { innerBodyStyle.overflowX = 'scroll'; + } else { + innerBodyStyle.overflowX = 'hidden'; } } else { bodyStyle.maxHeight = bodyStyle.maxHeight || scroll.y; diff --git a/src/Table.js b/src/Table.js index 1ff3ce1..ddc0924 100644 --- a/src/Table.js +++ b/src/Table.js @@ -298,7 +298,7 @@ class Table extends Component { this.isShowScrollY(); if (this.bodyTable) { const currentOverflowX = window.getComputedStyle(this.bodyTable).overflowX - if ((!this.props.scroll.x || this.props.scroll.x === '100%') && currentOverflowX === 'scroll') { + if ((!this.props.scroll.x || this.props.scroll.x === '100%') && currentOverflowX !== 'hidden') { this.bodyTable.style.overflowX = 'hidden'; } if ((this.props.scroll.x && this.props.scroll.x !== '100%') && currentOverflowX !== 'scroll') { @@ -1038,6 +1038,8 @@ class Table extends Component { innerBodyStyle.overflowY = bodyStyle.overflowY || 'scroll'; if (scroll.x && scroll.x !== '100%') { innerBodyStyle.overflowX = 'scroll'; + } else { + innerBodyStyle.overflowX = 'hidden'; } } else { bodyStyle.maxHeight = bodyStyle.maxHeight || scroll.y;