Skip to content

When "onClick" to close the menu is inserted, the menu does not scroll properly. #563

@nehiro

Description

@nehiro

Hi. I want to scroll to the id.
When it is at the top of the page, it works correctly, but if it is in the middle of the page or press the same link twice, it jumps to the top of the page.
Removing the onClick event will do the expected scrolling.
import { Link as Scroll } from 'react-scroll'; .... <Scroll onClick={() => setOpen(false)} smooth={true} to={item.to} duration={600} offset={-30}>{item.name}</Scroll>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions