Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Routing works, but scroll bar remains static #101

Open
alexnbuchanan opened this issue Aug 18, 2022 · 1 comment
Open

Routing works, but scroll bar remains static #101

alexnbuchanan opened this issue Aug 18, 2022 · 1 comment

Comments

@alexnbuchanan
Copy link

alexnbuchanan commented Aug 18, 2022

I added a HashLink, which (when I click "Projects" in my navbar) is to scroll to a section of my home page with an id of "projects". It works, the page is smooth scrolling to the correct section.

However, I'm noticing that my scroll bar isn't changing, and remains static. This is causing the section of my home page above the id to be cut off. Here is a video to demonstrate, notice the scroll bar doesn't change when I active the HashLink by clicking "Projects".

Is there a way I can correct this issue? My NavBar currently looks like this:

import React from "react";
import "./Nav.css";
import { HashLink } from "react-router-hash-link";

export default function Nav() {
  return (
    <div>
      <ul>
        <li>
          <a href="#">About</a>
        </li>
        <li>
          <HashLink smooth to="/#projects">
            Projects
          </HashLink>
        </li>
      </ul>
    </div>
  );
}
@anuragrootandleaves
Copy link

hey did you get any fix, cus I am also getting same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants