diff --git a/components/affix/nz-affix.component.ts b/components/affix/nz-affix.component.ts index ed0f3efaa3..fb61a41ba0 100644 --- a/components/affix/nz-affix.component.ts +++ b/components/affix/nz-affix.component.ts @@ -194,12 +194,13 @@ export class NzAffixComponent implements OnInit, OnDestroy { return; } this.placeholderNode.style.cssText = ''; - const widthObj = { width: this.placeholderNode.offsetWidth }; + this.placeholderStyle = undefined; + const styleObj = { width: this.placeholderNode.offsetWidth, height: this.fixedEl.nativeElement.offsetHeight }; this.setAffixStyle(e, { ...this.affixStyle, - ...widthObj + ...styleObj }); - this.setPlaceholderStyle(widthObj); + this.setPlaceholderStyle(styleObj); } @throttleByAnimationFrameDecorator()