Going by this thread, I was able to set my app up so that it navigates when one scrolls. I have just one issue, information for which have not been able to find anywhere! How do I set the "sensitivity" of the scroll event? My issue is that often even with the slightest scroll
, it navigates multiple routes rather than just giving me the next one. As you can see in the GIFF attached, this is with very light movement of my trackpad and it goes too fast from About to Tour to Gallery to all other navigation points! Is there a way to regulate the speed, delay, sensitivity anything?
The event listener is placed on all the components
like below! This is from my tours.component.ts
@HostListener('wheel', ['$event'])
onWheelScroll(evento: WheelEvent) {
// Scroll down go to gallery
if (evento.deltaY > 0) {
this.router.navigate(['gallery'])
// Scroll up go to about
} else {
this.router.navigate(['about'])
}
ignore
prop which would betrue
during scroll and simply ignore scrolling event when prop's true – Rescission