Scrolling to section stops moments before section as page changes
Unanswered
Ghost ant posted this in #help-forum
Ghost antOP
Hello, I have a problem on my site related to scrolling to a section from a certain id, however ONLY WHEN changing the page. What is my issue?
Suppose I have a home page "/" and a blog page "/blog". And that I am interested in the href="/#how-to" section which is only on the main page.
1) When I click on the corresponding<Link> in the navbar, i.e. <Link href="/how-to"/> BEING ON THE MAIN PAGE, I get redirected popranie, i.e. the page is scrolled down until the section is in the middle.
2. (PROBLEM IS HERE) When I click on the same link, i.e. <Link href="/#how-to"/> BEING on a page such as "/blog" I am correctly redirected to the home page but the page scrolls down slightly too fast.
I don't know what could be causing this problem and how to deal with it. I ADD that when I disable smooth-behaviour: smooth in main.css then in both cases the scrolling happens without any problem (however, this way I get rid of the effect of smooth scrolling to the section, which is what I care about)
Suppose I have a home page "/" and a blog page "/blog". And that I am interested in the href="/#how-to" section which is only on the main page.
1) When I click on the corresponding<Link> in the navbar, i.e. <Link href="/how-to"/> BEING ON THE MAIN PAGE, I get redirected popranie, i.e. the page is scrolled down until the section is in the middle.
2. (PROBLEM IS HERE) When I click on the same link, i.e. <Link href="/#how-to"/> BEING on a page such as "/blog" I am correctly redirected to the home page but the page scrolls down slightly too fast.
I don't know what could be causing this problem and how to deal with it. I ADD that when I disable smooth-behaviour: smooth in main.css then in both cases the scrolling happens without any problem (however, this way I get rid of the effect of smooth scrolling to the section, which is what I care about)