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

Loading…
Cancel
Save