diff --git a/package.json b/package.json index 241a140d7..dec8d418f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20230109200447", + "version": "2.0.20230113121657", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", diff --git a/src/case/combo/textvaluecombo/combo.textvalue.js b/src/case/combo/textvaluecombo/combo.textvalue.js index 9dc088639..bc43fce64 100644 --- a/src/case/combo/textvaluecombo/combo.textvalue.js +++ b/src/case/combo/textvaluecombo/combo.textvalue.js @@ -130,6 +130,7 @@ BI.TextValueCombo = BI.inherit(BI.Widget, { eventName: BI.Combo.EVENT_BEFORE_POPUPVIEW, action: () => { changeTag = false; + this.fireEvent(BI.TextValueCombo.EVENT_BEFORE_POPUPVIEW); } }, { eventName: BI.Combo.EVENT_AFTER_HIDEVIEW, @@ -209,5 +210,6 @@ BI.TextValueCombo = BI.inherit(BI.Widget, { this.combo.populate(items); } }); +BI.TextValueCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW"; BI.TextValueCombo.EVENT_CHANGE = "EVENT_CHANGE"; BI.shortcut("bi.text_value_combo", BI.TextValueCombo); diff --git a/src/core/platform/web/dom.js b/src/core/platform/web/dom.js index cc9ed0f8d..66f4b3651 100644 --- a/src/core/platform/web/dom.js +++ b/src/core/platform/web/dom.js @@ -745,13 +745,14 @@ * 获取position:fixed相对定位的元素的clientRect */ getPositionRelativeContainingBlockRect: function (element) { - var positionRelativeElement = BI.DOM.getPositionRelativeContainingBlock(element); - var rect = positionRelativeElement.getBoundingClientRect(); + const positionRelativeElement = BI.DOM.getPositionRelativeContainingBlock(element); + const { top, right, bottom, left, width, height, x, y } = positionRelativeElement.getBoundingClientRect(); + return { - ...rect.toJSON(), - scaleX: rect.width / positionRelativeElement.offsetWidth, - scaleY: rect.height / positionRelativeElement.offsetHeight + top, right, bottom, left, width, height, x, y, + scaleX: width / positionRelativeElement.offsetWidth, + scaleY: height / positionRelativeElement.offsetHeight, }; }, }); diff --git a/typescript/case/combo/combo.textvalue.ts b/typescript/case/combo/combo.textvalue.ts index 128ec03b6..f2a080ba5 100644 --- a/typescript/case/combo/combo.textvalue.ts +++ b/typescript/case/combo/combo.textvalue.ts @@ -4,6 +4,7 @@ export declare class TextValueCombo extends Widget { static xtype: string; static EVENT_CHANGE: string; + static EVENT_BEFORE_POPUPVIEW: string; clear(): void; setText(text: string): void;