Skip to content
This repository was archived by the owner on Nov 30, 2022. It is now read-only.

Commit 7d6bd41

Browse files
feat(popover): add optional viewportOnly input
1 parent 0f518e7 commit 7d6bd41

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

projects/core/src/lib/popover/popover.component.ts

+7
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export class FivPopover implements OnInit, AfterViewInit, OnDestroy {
5656
@Input() scrollSpeed = 100;
5757
@Input() position: PopoverPositioning = 'auto';
5858
@Input() classes: string[] = [];
59+
@Input() viewportOnly = true;
5960

6061
_position: PopoverPosition;
6162
hidden = false;
@@ -190,6 +191,9 @@ export class FivPopover implements OnInit, AfterViewInit, OnDestroy {
190191
}
191192

192193
private watchResize(target: HTMLElement) {
194+
if (!this.viewportOnly) {
195+
return;
196+
}
193197
fromEvent(window, 'resize')
194198
.pipe(
195199
flatMap(() => this.filterInViewport(target)),
@@ -202,6 +206,9 @@ export class FivPopover implements OnInit, AfterViewInit, OnDestroy {
202206
}
203207

204208
private watchScroll(target: HTMLElement) {
209+
if (!this.viewportOnly) {
210+
return;
211+
}
205212
if (this.content && !this.backdrop) {
206213
this.content.scrollEvents = true;
207214
merge(

0 commit comments

Comments
 (0)