Browse Source

BI-125791 fix: 【6.0.10发散】组件编辑界面,点击触发数据解释的热区后,按钮显示的位置会变来变去

es6
zsmj 2 years ago
parent
commit
6b711bc1e3
  1. 50
      packages/fineui/src/base/combination/combo.js

50
packages/fineui/src/base/combination/combo.js

@ -267,34 +267,34 @@ export class Combo extends Bubble {
belowMouse && isNotNull(e)
? {
element: {
0: e.target,
offset: () => {
0: extend({}, e.target, {
getBoundingClientRect: function () {
return {
left: e.pageX,
top: e.pageY,
width: 0,
height: 0,
};
}
}),
offset: function () {
return {
left: e.pageX,
top: e.pageY,
};
},
bounds: () => {
// offset为其相对于父定位元素的偏移
return {
x: e.offsetX,
y: e.offsetY,
width: 0,
height: 24,
};
},
outerWidth: () => 0,
outerHeight: () => 24,
},
}
: this.combo;
const positionRelativeElement = supportCSSTransform
? DOM.getPositionRelativeContainingBlock(
isNull(container)
? this.element[0]
: Widget._renderEngine.createElement(isFunction(container) ? container() : container)[0]
)
: null;
const positionRelativeElement = DOM.getPositionRelativeContainingBlock(
isNull(container)
? this.element[0]
: BI.isWidget(container)
? container.element[0]
: BI.Widget._renderEngine.createElement(isFunction(container) ? container() : container)[0]
);
const TRIANGLE_LENGTH = 12;
switch (direction) {
case "bottom":
@ -513,8 +513,14 @@ export class Combo extends Bubble {
const scaleX = positonedRect.width / positionRelativeElement.offsetWidth;
const scaleY = positonedRect.height / positionRelativeElement.offsetHeight;
p.top && (p.top = p.top / scaleY);
p.left && (p.left = p.left / scaleX);
p.top && (p.top = Math.round(p.top / scaleY + positionRelativeElement.scrollTop));
p.left && (p.left = Math.round(p.left / scaleX + positionRelativeElement.scrollLeft));
p.adaptHeight && (p.adaptHeight = Math.round(p.adaptHeight / scaleY));
}
if ("adaptHeight" in p) {
this.resetListHeight(p.adaptHeight);
}
if ("left" in p) {

Loading…
Cancel
Save