From 5c4d00ea1b1b0d203ff0516b9f9ce189631a562e Mon Sep 17 00:00:00 2001 From: dailer Date: Wed, 17 Jul 2019 09:10:53 +0800 Subject: [PATCH] =?UTF-8?q?BI-47693=20=20fix:=20=E7=8E=B0=E4=BB=A3?= =?UTF-8?q?=E6=B5=8F=E8=A7=88=E5=99=A8=E4=B8=AD=EF=BC=8CBI.ResizeDetector.?= =?UTF-8?q?addResizeListener=E4=BC=9A=E9=BB=98=E8=AE=A4=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E4=B8=80=E6=AC=A1=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/platform/web/detectElementResize.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/platform/web/detectElementResize.js b/src/core/platform/web/detectElementResize.js index 724fab307..0ca867207 100644 --- a/src/core/platform/web/detectElementResize.js +++ b/src/core/platform/web/detectElementResize.js @@ -112,8 +112,10 @@ }; var addResizeListener = function (element, fn) { - if (attachEvent) element.attachEvent("onresize", fn); - else { + if (attachEvent) { + element.attachEvent("onresize", fn); + fn(); + } else { if (!element.__resizeTriggers__) { if (getComputedStyle(element).position === "static") element.style.position = "relative"; createStyles();