Hi, thank you for your response.
As you can see, scrollToWrapper is a container that covers the entire screen. I expect this code to trigger a scrollTo when scrollToWrapper is about to enter the viewport, causing scrollToWrapper to scroll to the edge and align with the viewport, just like setting scroll-snap-align for an element.
Everything happens in an instant, and it may require multiple attempts to carefully observe the movement of the scroll bar in order to identify the issue. Indeed, as I mentioned, when scrollTo is triggered, the page does scroll to the top of the entire page first and then scrolls to the desired position