From 290ba7aed86f3872beb6edbd51ca017254853ad7 Mon Sep 17 00:00:00 2001 From: gx-mac Date: Thu, 4 Mar 2021 10:19:18 +0800 Subject: [PATCH] fix: css update --- build/Table.js | 4 +++- src/Table.js | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) 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;