I’m working on an Angular application where I have a function that scrolls to a specific section on the page. The scrolling works fine for sections 1 through 3, but for some reason, it doesn’t scroll to section 4.
Image 1: How it should behave
If I move section 4 higher on the page, the scrolling works as expected. The issue seems to occur only with the last section on the page.
I am aware that pinning section 4 after the navbar could be tricky due to the limited space at the bottom of the page. However, there’s still enough space below, so this shouldn’t be the cause (as shown in the attached image).
Image 2: Section-4 scrolls to here
Image 3: Section-4 should scroll to here
This problem only occurs locally, and I haven’t been able to reproduce it consistently elsewhere. Any insights or suggestions on how to resolve this would be greatly appreciated.
Stackblitz Demo