Browse Source

REPORT-119215 fix: 统一使用clientWidth和clientHeight,父页面代理掉子应用的body的clientHeight和clientWidth到父应用的body上

research/test
jian 8 months ago
parent
commit
27f84abf07
  1. 4
      packages/fineui/src/core/controller/controller.popover.js

4
packages/fineui/src/core/controller/controller.popover.js

@ -58,8 +58,8 @@ export class PopoverController extends Controller {
const popover = this.get(name); const popover = this.get(name);
popover.show && popover.show(); popover.show && popover.show();
const render = this.getRender(); const render = this.getRender();
const elRect = Widget._renderEngine.createElement(render)[0].getBoundingClientRect(); const el = Widget._renderEngine.createElement(render)[0];
const W = elRect.width, H = elRect.height; const W = el.clientWidth, H = el.clientHeight;
const w = popover.element.width(), h = popover.element.height(); const w = popover.element.width(), h = popover.element.height();
let left = (W - w) / 2, top = (H - h) / 2; let left = (W - w) / 2, top = (H - h) / 2;
if (left < 0) { if (left < 0) {

Loading…
Cancel
Save