From e0c74501f4ba91fbdc19f1ddeea1c110da2bc8bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=96=B0=E8=88=AA?= Date: Thu, 20 Dec 2018 15:13:10 +0800 Subject: [PATCH] feat: The run update-position when first mounted, to get the actual styles. --- components/affix/index.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/affix/index.tsx b/components/affix/index.tsx index ce880527d3..88530d5514 100644 --- a/components/affix/index.tsx +++ b/components/affix/index.tsx @@ -218,6 +218,8 @@ export default class Affix extends React.Component { // Wait for parent component ref has its value this.timeout = setTimeout(() => { this.setTargetEventListeners(target); + // Mock Event object. + this.updatePosition({} as Event); }); }