I was having a hard time figuring out how to limit the scrolling on an element. I made a little example that only allows scrolling within a container. You can add a threshold that allows the content briefly move outside the container. Let me know what you think!
I'm not sure if this has been discussed before, so I apologize if this is a repeat post.