Skip to content

Scroll to section with id from a hashed url #130

@SmartNetAR

Description

@SmartNetAR

Describe the bug

It happened to me like in the issue 83 report #83 that luckily I solved it. Since I can scroll from the same page to the section with id. Eg <section id="contact">...</section> using Link or NavLink.
But the problem is when I load the page from a url in a new tab, for example localhost:3000/#contact or localhost:3000#contact, the scroll is always positioned at the top.
I appreciate if you can tell me if I'm doing something wrong.

Your Example Website or App

https://digichanges.com/#about

Steps to Reproduce the Bug or Issue

If you click on the links, you will see that it scrolls correctly

If you load the url in the browser you will see that it does not scroll to the corresponding section https://digichanges.com/#about

Expected behavior

I would expect that when accessing the site, it would scroll to the section identified in the url after the #

Screenshots or Videos

No response

Platform

  • OS: [macOS, Linux]
  • Browser: [Chrome, Safari]

Additional context

Without the router it worked fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions