Skip to content

Sentry will have an error of Cannot read property 'scrollLeft' of null; not required #5570

@songxianling

Description

@songxianling
  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

1.7.7

Environment

vue2.6.11

Reproduction link

http://Examples

Steps to reproduce

TypeError
Cannot read property 'scrollLeft' of null

./node_modules/_ant-design-vue@1.7.8@ant-design-vue/es/vc-table/src/Table.js 位置 setScrollPositionClassName 行 233:31

}
}
},
setScrollPositionClassName: function setScrollPositionClassName() {
var node = this.ref_bodyTable;
var scrollToLeft = node.scrollLeft === 0; // 提示是这一行报错的
var scrollToRight = node.scrollLeft 1 >= node.children[0].getBoundingClientRect().width - node.getBoundingClientRect().width;
if (scrollToLeft && scrollToRight) {
this.setScrollPosition('both');
} else if (scrollToLeft) {
this.setScrollPosition('left');

What is expected?

不报错

What is actually happening?

会有偶发的错误;非必现;监控平台发现

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions