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

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

Open
nehiro opened this issue Sep 6, 2023 · 1 comment

Comments

@nehiro
Copy link

nehiro commented Sep 6, 2023

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>

@fisshy
Copy link
Owner

fisshy commented Nov 1, 2023

Do you a have a codepen/plunkr to demonstrate the 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