Skip to content

Commit 5ee5e99

Browse files
authored
fix: set popover height correctly based on position (#557)
1 parent 167fc39 commit 5ee5e99

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

projects/components/src/overlay/sheet/sheet-overlay.component.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { ChangeDetectionStrategy, Component, Inject, Injector, TemplateRef, Type
22
import { IconType } from '@hypertrace/assets-library';
33
import { GLOBAL_HEADER_HEIGHT, LayoutChangeService } from '@hypertrace/common';
44
import { ButtonStyle } from '../../button/button';
5-
import { POPOVER_DATA } from '../../popover/popover';
5+
import { PopoverFixedPositionLocation, POPOVER_DATA } from '../../popover/popover';
66
import { PopoverRef } from '../../popover/popover-ref';
77
import { SheetConstructionData } from '../overlay.service';
88
import { SheetOverlayConfig, SheetSize } from './sheet';
@@ -58,7 +58,7 @@ export class SheetOverlayComponent {
5858
this.size = sheetConfig.size;
5959
this.isComponentSheet = !(sheetConfig.content instanceof TemplateRef);
6060
this.renderer = sheetConfig.content;
61-
this.popoverRef.height(`calc(100vh - ${globalHeaderHeight})`);
61+
this.popoverRef.height(this.getHeightForPopover(globalHeaderHeight, sheetConfig.position));
6262

6363
if (this.size === SheetSize.ResponsiveExtraLarge) {
6464
this.popoverRef.width('60%');
@@ -79,4 +79,8 @@ export class SheetOverlayComponent {
7979
this.visible = false;
8080
this.popoverRef.close();
8181
}
82+
83+
private getHeightForPopover(globalHeaderHeight: string, position?: PopoverFixedPositionLocation): string {
84+
return position === PopoverFixedPositionLocation.Right ? '100vh' : `calc(100vh - ${globalHeaderHeight})`;
85+
}
8286
}

0 commit comments

Comments
 (0)