-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Trigger the Menu to close #120
Comments
Hey! Thank you for your feature suggestion! I'm trying to understand why this isn't working already? If you click a link to change a route, then it should already close because it is considered an "outside click". Are you doing programatic redirects without any user interaction at all? |
I'm clicking a link inside the menu using NextJS If I change route from outside the menu (another part of the header nav) then the menu closes correctly |
Sorry for the late answer! I think that the function NextLink(props) {
const { href, children, ...rest } = props;
return (
<Link href={href}><a {...rest}>{children}</a></Link>
)
} You can then use it as: <Menu.Item as={NextLink}>...</Menu.Item> |
That has worked! Thank you very much for your help |
Perfect! |
I was trying using it like described, but it wouldn't let me. Can you elaborate on what to insert in the |
@mathiassdev I think that it would be easier if you open a new issue with a minimal reproduction repository, the current behaviour (and/or errors) and the expected behaviour. |
Hello, great work on this library!
I've implemented the
Menu
component in a NextJS project - all working fine. I'm wondering if there is ability to close the menu without a click, say when you change a route?If the close action can be exposed then this could be called on route change.
Thanks!
The text was updated successfully, but these errors were encountered: