fix: scrollbar issue

This commit is contained in:
gx-mac 2021-03-01 02:07:39 +08:00
parent abf567d6da
commit 6b8ad2414e
2 changed files with 9 additions and 2 deletions

View File

@ -497,9 +497,13 @@ var Table = function (_Component) {
// 是否传入 scroll中的y属性如果传入判断是否是整数如果是则进行比较 。bodyTable 的clientHeight进行判断 // 是否传入 scroll中的y属性如果传入判断是否是整数如果是则进行比较 。bodyTable 的clientHeight进行判断
this.isShowScrollY(); this.isShowScrollY();
if (this.bodyTable) { if (this.bodyTable) {
if (!this.props.scroll.x && window.getComputedStyle(this.bodyTable).overflowX !== 'hidden') { var currentOverflowX = window.getComputedStyle(this.bodyTable).overflowX;
if (!this.props.scroll.x && currentOverflowX === 'scroll') {
this.bodyTable.style.overflowX = 'hidden'; this.bodyTable.style.overflowX = 'hidden';
} }
if (this.props.scroll.x && currentOverflowX !== 'scroll') {
this.bodyTable.style.overflowX = 'scroll';
}
} }
if (this.bodyTableOuter) { if (this.bodyTableOuter) {
// 隐藏几个不需要真正滚动的父元素的滚动条 // 隐藏几个不需要真正滚动的父元素的滚动条
@ -1207,6 +1211,9 @@ var Table = function (_Component) {
// bodyStyle.height = bodyStyle.height || scroll.y; // bodyStyle.height = bodyStyle.height || scroll.y;
innerBodyStyle.maxHeight = bodyStyle.maxHeight || scroll.y; innerBodyStyle.maxHeight = bodyStyle.maxHeight || scroll.y;
innerBodyStyle.overflowY = bodyStyle.overflowY || 'scroll'; innerBodyStyle.overflowY = bodyStyle.overflowY || 'scroll';
if (scroll.x) {
innerBodyStyle.overflowX = 'scroll';
}
} else { } else {
bodyStyle.maxHeight = bodyStyle.maxHeight || scroll.y; bodyStyle.maxHeight = bodyStyle.maxHeight || scroll.y;
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "bee-table", "name": "bee-table",
"version": "2.3.15-beta.1", "version": "2.3.15-beta.2",
"description": "Table ui component for react", "description": "Table ui component for react",
"keywords": [ "keywords": [
"react", "react",