🐛 Fix Affix throws Cannot read property getBoundingClientRect (#21350)

close #21348
This commit is contained in:
偏右 2020-02-12 13:03:32 +08:00 committed by afc163
parent dd16a24426
commit 4db7cbcf43

View File

@ -239,7 +239,7 @@ class Affix extends React.Component<AffixProps, AffixState> {
const offsetBottom = this.getOffsetBottom();
const targetNode = target();
if (targetNode) {
if (targetNode && this.placeholderNode) {
const targetRect = getTargetRect(targetNode);
const placeholderReact = getTargetRect(this.placeholderNode);
const fixedTop = getFixedTop(placeholderReact, targetRect, offsetTop);