How can I controll scrolling in a react website?
09:05 08 Oct 2026

I am trying to make a personal website for myself, and I wanted to control the scrolling, so that after the first page, the user HAS TO stop at a pre-determined point on the page. The problem is its not working. Searching and using AI led me to a solution -

.snapContainer {
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
}

.section {
  height: 100vh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

This is super buggy though. Like, right now, when I scroll, it does not stop at the start of the next section. Instead, it stops at almost the bottom of the second section, I have no clue why.

On my hosted website, the issue is different. Its an older build, I want to push when this issue is sorted. The issue on the hosted one is that scrolling down, the snapping works, but when I try to scroll back up, it snaps somewhere random.

Heres the link to check that out - kalerkaler.vercel.app

Link to github repo - https://github.com/KalerKaler/KalerKaler.github.io

css reactjs scroll