scroll y为true时横向滚动条计算有问题

This commit is contained in:
wanghaoo 2018-11-08 17:53:37 +08:00
parent 02f26141a5
commit 2ecdcf74e4
5 changed files with 121 additions and 97 deletions

8
dist/demo.css vendored
View File

@ -8665,10 +8665,10 @@ ul {
.u-table-filter-column-filter-icon {
position: absolute;
top: 3px;
right: 2px;
width: 25px;
height: 38px;
line-height: 38px;
right: 18px;
width: 22px;
height: 30px;
line-height: 30px;
z-index: 2;
background: #f7f7f7; }
.u-table-filter-column-filter-iconi.uf {

2
dist/demo.css.map vendored

File diff suppressed because one or more lines are too long

198
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

@ -129,6 +129,10 @@ class Table extends Component {
componentDidMount() {
setTimeout(this.resetScrollY, 300);
//含有纵向滚动条
if(this.props.scroll.y){
this.scrollbarWidth = measureScrollbar();
}
//后续也放在recevice里面
if (!this.props.originWidth) {
this.computeTableWidth();
@ -215,7 +219,7 @@ class Table extends Component {
let lastShowIndex = computeObj.lastShowIndex;
this.computeWidth = computeObj.computeWidth;
if (this.computeWidth < this.contentWidth) {
let contentWidthDiff = this.contentWidth - this.computeWidth;
let contentWidthDiff = this.scrollbarWidth?this.contentWidth - this.computeWidth-this.scrollbarWidth:this.contentWidth - this.computeWidth;
this.setState({ contentWidthDiff, lastShowIndex });
} else {
this.contentWidth = this.computeWidth;
@ -645,7 +649,7 @@ class Table extends Component {
useFixedHeader = true;
// Add negative margin bottom for scroll bar overflow bug
const scrollbarWidth = measureScrollbar();
const scrollbarWidth = this.scrollbarWidth;
if (scrollbarWidth >= 0) {
(fixed ? bodyStyle : headStyle).paddingBottom = '0px';
//显示表头滚动条