From b1da50461bcfd98539c698c29b30074aa28f4c59 Mon Sep 17 00:00:00 2001 From: jian Date: Wed, 24 Apr 2024 16:22:31 +0800 Subject: [PATCH 1/3] =?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; } From 3ed4b251f1068bd54ce927476dd3fb6cfcb29f1f Mon Sep 17 00:00:00 2001 From: jian Date: Wed, 24 Apr 2024 18:07:35 +0800 Subject: [PATCH 2/3] =?UTF-8?q?REPORT-119215=20fix:=20=E7=BB=9F=E4=B8=80?= =?UTF-8?q?=E4=BD=BF=E7=94=A8clientWidth=E5=92=8CclientHeight,=E7=88=B6?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=BB=A3=E7=90=86=E6=8E=89=E5=AD=90=E5=BA=94?= =?UTF-8?q?=E7=94=A8=E7=9A=84body=E7=9A=84clientHeight=E5=92=8CclientWidth?= =?UTF-8?q?=E5=88=B0=E7=88=B6=E5=BA=94=E7=94=A8=E7=9A=84body=E4=B8=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/fineui/src/base/layer/layer.popover.js | 8 ++++---- packages/fineui/webpack/webpack.dev.js | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/fineui/src/base/layer/layer.popover.js b/packages/fineui/src/base/layer/layer.popover.js index d7649c389..0f08ac097 100644 --- a/packages/fineui/src/base/layer/layer.popover.js +++ b/packages/fineui/src/base/layer/layer.popover.js @@ -198,11 +198,11 @@ export class Popover extends Widget { mounted() { this.startX = 0; this.startY = 0; - const bodyDom = getOuterBody(); this.tracker = new MouseMoveTracker( (deltaX, deltaY) => { - const W = Widget._renderEngine.createElement(bodyDom).width(); - const H = Widget._renderEngine.createElement(bodyDom).height(); + const el = Widget._renderEngine.createElement(getOuterBody())[0]; + const W = el.clientWidth; + const H = el.clientHeight; this.startX += deltaX; this.startY += deltaY; this.element.css({ @@ -246,7 +246,7 @@ export class Popover extends Widget { } _getSuitableWidth(width) { - return clamp(width, 0, Widget._renderEngine.createElement(getOuterBody()).width()); + return clamp(width, 0, Widget._renderEngine.createElement(getOuterBody())[0].clientWidth); } _calculateSize() { diff --git a/packages/fineui/webpack/webpack.dev.js b/packages/fineui/webpack/webpack.dev.js index 3b795e02d..1f80646d2 100644 --- a/packages/fineui/webpack/webpack.dev.js +++ b/packages/fineui/webpack/webpack.dev.js @@ -6,7 +6,7 @@ const dirs = require("./dirs"); module.exports = merge(common, { mode: "development", - devtool: "inline-source-map", + devtool: "eval-source-map", output: { path: dirs.DEST, @@ -14,14 +14,14 @@ module.exports = merge(common, { }, devServer: { + headers: { + "Access-Control-Allow-Origin": "*", + }, port: 9001, // liveReload: true, client: { logging: 'error', - overlay: { - errors: true, - warnings: false, - }, + overlay: false, }, } }); From 27f84abf072e1d4138e12eece00b054ae7c687ec Mon Sep 17 00:00:00 2001 From: jian Date: Wed, 24 Apr 2024 18:08:50 +0800 Subject: [PATCH 3/3] =?UTF-8?q?REPORT-119215=20fix:=20=E7=BB=9F=E4=B8=80?= =?UTF-8?q?=E4=BD=BF=E7=94=A8clientWidth=E5=92=8CclientHeight,=E7=88=B6?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=BB=A3=E7=90=86=E6=8E=89=E5=AD=90=E5=BA=94?= =?UTF-8?q?=E7=94=A8=E7=9A=84body=E7=9A=84clientHeight=E5=92=8CclientWidth?= =?UTF-8?q?=E5=88=B0=E7=88=B6=E5=BA=94=E7=94=A8=E7=9A=84body=E4=B8=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/fineui/src/core/controller/controller.popover.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/fineui/src/core/controller/controller.popover.js b/packages/fineui/src/core/controller/controller.popover.js index 40f0edf29..d8a800780 100644 --- a/packages/fineui/src/core/controller/controller.popover.js +++ b/packages/fineui/src/core/controller/controller.popover.js @@ -58,8 +58,8 @@ export class PopoverController extends Controller { const popover = this.get(name); popover.show && popover.show(); const render = this.getRender(); - const elRect = Widget._renderEngine.createElement(render)[0].getBoundingClientRect(); - const W = elRect.width, H = elRect.height; + const el = Widget._renderEngine.createElement(render)[0]; + const W = el.clientWidth, H = el.clientHeight; const w = popover.element.width(), h = popover.element.height(); let left = (W - w) / 2, top = (H - h) / 2; if (left < 0) {