From b1da50461bcfd98539c698c29b30074aa28f4c59 Mon Sep 17 00:00:00 2001 From: jian Date: Wed, 24 Apr 2024 16:22:31 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-119215=20fix:=20=E7=BB=9F=E4=B8=80?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=AE=BD=E9=AB=98=E7=9A=84=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/core/controller/controller.popover.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/fineui/src/core/controller/controller.popover.js b/packages/fineui/src/core/controller/controller.popover.js index c4b8337b8..40f0edf29 100644 --- a/packages/fineui/src/core/controller/controller.popover.js +++ b/packages/fineui/src/core/controller/controller.popover.js @@ -38,7 +38,7 @@ export class PopoverController extends Controller { type: "bi.popover", }, context); this.add(name, popover, options, context); - + return this; } @@ -58,8 +58,8 @@ export class PopoverController extends Controller { const popover = this.get(name); popover.show && popover.show(); const render = this.getRender(); - const W = Widget._renderEngine.createElement(render).width(), - H = Widget._renderEngine.createElement(render).height(); + const elRect = Widget._renderEngine.createElement(render)[0].getBoundingClientRect(); + const W = elRect.width, H = elRect.height; const w = popover.element.width(), h = popover.element.height(); let left = (W - w) / 2, top = (H - h) / 2; if (left < 0) { @@ -74,7 +74,7 @@ export class PopoverController extends Controller { top: `${top}px`, }); } - + return this; } @@ -87,7 +87,7 @@ export class PopoverController extends Controller { this.floatContainer[name].invisible(); this.modal && this.floatContainer[name].element.__releaseZIndexMask__(this.zindexMap[name]); } - + return this; } @@ -135,7 +135,7 @@ export class PopoverController extends Controller { bottom: 0, }], }); - + return this; } @@ -167,7 +167,7 @@ export class PopoverController extends Controller { delete this.zindexMap[name]; delete this.floatContainer[name]; delete this.floatOpened[name]; - + return this; } @@ -181,7 +181,7 @@ export class PopoverController extends Controller { this.floatContainer = {}; this.floatOpened = {}; this.zindexMap = {}; - + return this; }