’columns宽度不同时重置scrollTop‘
This commit is contained in:
parent
ba8837b04c
commit
059414bfae
|
@ -8501,7 +8501,7 @@ ul {
|
|||
.u-table-row-expand-icon, .u-table-expanded-row-expand-icon {
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
margin-right: 10px;
|
||||
margin-right: 0px;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
text-align: center;
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -68,6 +68,7 @@ const defaultProps = {
|
|||
rowRef: () => null,
|
||||
getBodyWrapper: body => body,
|
||||
emptyText: () => 'No Data',
|
||||
columns:[],
|
||||
minColumnWidth: 80
|
||||
};
|
||||
|
||||
|
@ -156,10 +157,11 @@ class Table extends Component {
|
|||
}
|
||||
if (nextProps.columns && nextProps.columns !== this.props.columns) {
|
||||
this.columnManager.reset(nextProps.columns);
|
||||
if (this.refs && this.refs.bodyTable) {
|
||||
//如果列变了,对应的table的ScrollTop属性置为0
|
||||
this.refs.bodyTable.scrollTop = 0;
|
||||
if(nextProps.columns.length !== this.props.length && this.refs && this.refs.bodyTable){
|
||||
this.refs.fixedColumnsBodyLeft && ( this.refs.fixedColumnsBodyLeft.scrollTop = this.refs.bodyTable.scrollTop);
|
||||
this.refs.fixedColumnsBodyRight && ( this.refs.fixedColumnsBodyRight.scrollTop = this.refs.bodyTable.scrollTop);
|
||||
}
|
||||
|
||||
} else if (nextProps.children !== this.props.children) {
|
||||
this.columnManager.reset(null, nextProps.children);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue