fix: scroll.x传100%的时候不显示各类滚动条

This commit is contained in:
gx-mac 2021-03-03 22:08:00 +08:00
parent cb7d54be80
commit 3c0aa855a7
6 changed files with 2772 additions and 2488 deletions

File diff suppressed because one or more lines are too long

4
dist/demo.css vendored
View File

@ -452,8 +452,8 @@
color: rgb(33, 33, 33);
background-clip: padding-box;
-webkit-user-select: none;
/*
Introduced in IE 10.
/*
Introduced in IE 10.
*/
-ms-user-select: none;
user-select: none; }

2
dist/demo.css.map vendored

File diff suppressed because one or more lines are too long

5239
dist/demo.js vendored

File diff suppressed because one or more lines are too long

2
dist/demo.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -298,10 +298,10 @@ class Table extends Component {
this.isShowScrollY();
if (this.bodyTable) {
const currentOverflowX = window.getComputedStyle(this.bodyTable).overflowX
if (!this.props.scroll.x && currentOverflowX === 'scroll') {
if ((!this.props.scroll.x || this.props.scroll.x === '100%') && currentOverflowX === 'scroll') {
this.bodyTable.style.overflowX = 'hidden';
}
if (this.props.scroll.x && currentOverflowX !== 'scroll') {
if ((this.props.scroll.x && this.props.scroll.x !== '100%') && currentOverflowX !== 'scroll') {
this.bodyTable.style.overflowX = 'scroll';
}
}
@ -1024,7 +1024,7 @@ class Table extends Component {
if(this.props.data.length == 0 && this.props.headerScroll ){
bodyStyle.overflowX = 'hidden';
}
if (!footerScroll) {
if (!footerScroll && scroll.x !== '100%') {
bodyStyle.overflowX = bodyStyle.overflowX || 'auto';
}
}
@ -1036,7 +1036,7 @@ class Table extends Component {
// bodyStyle.height = bodyStyle.height || scroll.y;
innerBodyStyle.maxHeight = bodyStyle.maxHeight || scroll.y;
innerBodyStyle.overflowY = bodyStyle.overflowY || 'scroll';
if (scroll.x) {
if (scroll.x && scroll.x !== '100%') {
innerBodyStyle.overflowX = 'scroll';
}
} else {
@ -1164,6 +1164,9 @@ class Table extends Component {
}
delete bodyStyle.overflowX;
delete bodyStyle.overflowY;
if (scroll.x === '100%') {
delete bodyStyle.marginBottom
}
BodyTable = (
<div
className={`${clsPrefix}-body-outer`}