Detect normal scroll with scrollToPoint

I am using ion-content and it’s scroll methods in the Ionic react.

I want to update the header based on the scroll.I am using onIonScroll to detect the scrollY position. in which I passed handleScroll function
I also want to navigate to a specific point with scrollToPoint method.

The issue I am facing is I have some code to update the header for in handleScroll, but when I call scrollToPoint this scroll function handleScroll is called internally and updates the value.

I want to detect when the function is called by user action and when the function is called from handle scroll

It sounds like you just need to separate out the storing of the scroll value w/ the updating of it in scrollToPoint. Some flag or delay on whether or not you react to scroll events while scrolling could help. Hard to say more without seeing code