fix: 懒加载时修改table的scrollTop
This commit is contained in:
parent
27c08b3f0d
commit
69d6a2216b
File diff suppressed because one or more lines are too long
|
@ -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; }
|
||||
|
|
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
|
@ -270,10 +270,10 @@ class Table extends Component {
|
|||
// if (prevProps.data.length === 0 || this.props.data.length === 0 ) {
|
||||
// this.resetScrollX();
|
||||
// }
|
||||
// 当手动设置的scroll.y发生变化时,滚动条回到顶部
|
||||
// 当懒加载手动设置的scroll.y发生变化时,滚动条回到顶部
|
||||
const prevScrollY = prevProps.scroll.y
|
||||
const currentScrollY = this.props.scroll.y
|
||||
if (prevScrollY && currentScrollY && (prevScrollY !== currentScrollY)) {
|
||||
if (prevScrollY && currentScrollY && (prevScrollY !== currentScrollY) && this.props.lazyLoad) {
|
||||
this.bodyTable.scrollTop = 0
|
||||
}
|
||||
// 是否传入 scroll中的y属性,如果传入判断是否是整数,如果是则进行比较 。bodyTable 的clientHeight进行判断
|
||||
|
|
Loading…
Reference in New Issue