fix: scrollbar css
This commit is contained in:
parent
e1d73a9c33
commit
abf567d6da
11
src/Table.js
11
src/Table.js
|
@ -286,8 +286,12 @@ class Table extends Component {
|
|||
// 是否传入 scroll中的y属性,如果传入判断是否是整数,如果是则进行比较 。bodyTable 的clientHeight进行判断
|
||||
this.isShowScrollY();
|
||||
if (this.bodyTable) {
|
||||
if (!this.props.scroll.x && window.getComputedStyle(this.bodyTable).overflowX !== 'hidden') {
|
||||
this.bodyTable.style.overflowX = 'hidden'
|
||||
const currentOverflowX = window.getComputedStyle(this.bodyTable).overflowX
|
||||
if (!this.props.scroll.x && currentOverflowX === 'scroll') {
|
||||
this.bodyTable.style.overflowX = 'hidden';
|
||||
}
|
||||
if (this.props.scroll.x && currentOverflowX !== 'scroll') {
|
||||
this.bodyTable.style.overflowX = 'scroll';
|
||||
}
|
||||
}
|
||||
if (this.bodyTableOuter) { // 隐藏几个不需要真正滚动的父元素的滚动条
|
||||
|
@ -1021,6 +1025,9 @@ class Table extends Component {
|
|||
// bodyStyle.height = bodyStyle.height || scroll.y;
|
||||
innerBodyStyle.maxHeight = bodyStyle.maxHeight || scroll.y;
|
||||
innerBodyStyle.overflowY = bodyStyle.overflowY || 'scroll';
|
||||
if (scroll.x) {
|
||||
innerBodyStyle.overflowX = 'scroll';
|
||||
}
|
||||
} else {
|
||||
bodyStyle.maxHeight = bodyStyle.maxHeight || scroll.y;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue