Skip to content

Commit 3c31281

Browse files
committed
Merge branch 'main' into fix/popover-positioning-max-block-size
2 parents 7c2dc5b + 8544295 commit 3c31281

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/components/popover/popover.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,9 @@ export class ChPopover {
841841
) => {
842842
if (this.inlineSizeMatch === "action-element-as-minimum") {
843843
setProperty(this.el, POPOVER_MIN_INLINE_SIZE, actionRect.width);
844-
return actionRect.width;
844+
845+
// TODO: Add e2e tests for this
846+
return Math.max(actionRect.width, popoverRect.width);
845847
}
846848

847849
// Size is determined by the content
@@ -860,12 +862,9 @@ export class ChPopover {
860862
) => {
861863
if (this.blockSizeMatch === "action-element-as-minimum") {
862864
setProperty(this.el, POPOVER_MIN_BLOCK_SIZE, actionRect.height);
863-
return actionRect.height;
864-
}
865865

866-
// Size is determined by the content
867-
if (this.#resizeWasMade || this.blockSizeMatch === "content") {
868-
return popoverRect.height;
866+
// TODO: Add e2e tests for this
867+
return Math.max(actionRect.height, popoverRect.height);
869868
}
870869

871870
// Size is the same as the `actionElement`

0 commit comments

Comments
 (0)