Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

219
Vistas
I have side navigation and when I scroll down to pick a certain page, the navigation bar jumps to the top of the page

I have been looking for the solution here on stackoverflow, but couldn't find any correct way to solve the issue.

My issue: I have side navigation bar on the left, when i scroll down and select certain page the navigation bar jumps to the top of the navigation bar. I want navigation bar to remain on the same position when I clicked. Pls advise.

HERE IS THE CODE:

  const LayoutWithSidebar = ({ toggleSideBar, setToggleSidebar, btn }) => {
  const { t } = useTranslation();
  const handleEnterMouse = () => {
    setToggleSidebar(true);
  };
  return (
    <aside
      className={`left-sidebar-style ${
        toggleSideBar ? 'open-left-sidebar' : 'left-sidebar'
      }`}
      onMouseEnter={handleEnterMouse}
      data-sidebarbg="skin5">
      <div className="scroll-sidebar">
        <UserProfile btn={btn} toggleSideBar={toggleSideBar} translation={t} />
        <SidebarLinks btn={btn} toggleSideBar={toggleSideBar} translation={t} />
      </div>
      {(toggleSideBar || btn) && <SidebarFooter />}
      <style jsx toggleSideBar={toggleSideBar}>
        {Styles}
      </style>
    </aside>
  );
};

export default LayoutWithSidebar;

SideBarLinks.js file

const SidebarLinks = (props) => {
  return (
    <nav className="sidebar-nav fixed">
      <ul id="sidebarnav" className="in">
        {navItems.map((navItem) => (
          <SidebarItem key={navItem.transKey} {...navItem} {...props} />
        ))}
      </ul>
    </nav>
  );
};

export default SidebarLinks;

Thank you.

about 4 years ago · Santiago Gelvez
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda