/** * This generic method is to handle the scroll event and show box shadow below header * @param scrollEvent */ export function handleScroll(this: any, scrollEvent: any) { const listContainer = scrollEvent.target; if (!this.scrolling) { this.scrolling = true; // Set a timeout to handle scroll event after a delay setTimeout(() => { // Check if scrolled this.showBoxShadow = listContainer.scrollTop > 0 && listContainer.scrollHeight > listContainer.clientHeight; // Reset scrolling back to false after handling the scroll this.scrolling = false; }, 200); } }