I am facing difficulty in accessing a specific scrollbar from a component in my web page. The page contains multiple scrollbars, and I need to target and modify the position of a particular scrollbar (scrollTop).
I have tried implementing the following code in the child component to display a single scrollbar in a div (refer to the screenshot below):
@HostListener('window:scroll', ['$event']) onScrollEvent($event: any) {
console.log(window.pageYOffset);
}
However, I noticed that this event is only triggered when I adjust the scrollbar in the parent component.