diff --git a/packages/main/src/Popover.js b/packages/main/src/Popover.js index a745bea4d999..c1fb83e2a6e3 100644 --- a/packages/main/src/Popover.js +++ b/packages/main/src/Popover.js @@ -489,7 +489,8 @@ class Popover extends Popup { this._maxContentHeight = maxContentHeight; - const arrowTranslateX = isVertical ? targetRect.left + targetRect.width / 2 - left - popoverSize.width / 2 : 0; + const arrowXCentered = this.horizontalAlign === PopoverHorizontalAlign.Center || this.horizontalAlign === PopoverHorizontalAlign.Stretch; + const arrowTranslateX = isVertical && arrowXCentered ? targetRect.left + targetRect.width / 2 - left - popoverSize.width / 2 : 0; const arrowTranslateY = !isVertical ? targetRect.top + targetRect.height / 2 - top - popoverSize.height / 2 : 0; if (this._left === undefined || Math.abs(this._left - left) > 1.5) { diff --git a/packages/main/test/pages/Popover.html b/packages/main/test/pages/Popover.html index 65a74fc84a6f..0e3c001a6af9 100644 --- a/packages/main/test/pages/Popover.html +++ b/packages/main/test/pages/Popover.html @@ -314,6 +314,49 @@ +
+
+
+ + Open Popup Left aligned + + +
+ I am in the header +
+
+ I am in the header +
+
+ I am in the header +
+
+ +
+ + Open Popup Right aligned + + +
+ I am in the header +
+
+ I am in the header +
+
+ I am in the header +
+
+ +
+
+