Skip to content

Commit 16a48bb

Browse files
committed
fix: 🐛 use function in appendTo
1 parent f5960c3 commit 16a48bb

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

projects/ngneat/helipopper/src/lib/tippy.directive.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ export class TippyDirective implements OnChanges, AfterViewInit, OnInit {
385385
this.tippyFactory
386386
.create(this.host(), {
387387
allowHTML: true,
388-
appendTo: document.fullscreenElement || document.body,
388+
appendTo: () => document.fullscreenElement || document.body,
389389
...(this.globalConfig.zIndexGetter
390390
? { zIndex: this.globalConfig.zIndexGetter() }
391391
: {}),
@@ -589,10 +589,11 @@ export class TippyDirective implements OnChanges, AfterViewInit, OnInit {
589589
// "Unexpected emit for destroyed `OutputRef`".
590590
if (!this.destroyed) {
591591
this.isVisible.set(isVisible);
592+
this.ngZone.run(() => this.visible.emit(isVisible));
592593
this.onHide.emit();
593594
}
594595
this.visibleInternal.next(isVisible);
595-
this.ngZone.run(() => this.visible.emit(isVisible));
596+
596597
this.globalConfig.onHidden?.(instance);
597598
}
598599

src/app/playground/playground.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- <button (click)="show = !show">Toggle All</button> -->
1+
<button (click)="show = !show">Toggle All</button>
22

33
<ng-container *ngIf="show">
44
<div

0 commit comments

Comments
 (0)