Browse Source

REPORT-119215 fix: 统一获取宽高的方法

research/test
jian 7 months ago
parent
commit
b1da50461b
  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);
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) {

Loading…
Cancel
Save