Skip to content

Commit

Permalink
fix IntersectionObserver error with rootMargin
Browse files Browse the repository at this point in the history
  • Loading branch information
danielzlatanov committed Oct 30, 2024
1 parent 45c887b commit 12d0855
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/app/core/header/header.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ export class HeaderComponent implements AfterViewInit {
(entries) => {
this.isButtonVisible = entries[0].isIntersecting;
},
{ threshold: 1.5 }
{
threshold: 1,
rootMargin: '-50% 0px -50% 0px',
}
);

this.observer.observe(this.burgerBtn.nativeElement);
Expand Down

0 comments on commit 12d0855

Please sign in to comment.