Describe the bug

As shown above while selecting link which is wrapped in next/link in MenuItem, MenuList isn't closing automatically as it does for normal links or any items in menu list
Is there any workaround/way to close menu on dynamic links selection?
Expected Behavior
It should automatically close on selection
To Reproduce
next/linkSuggested solution(s)
Desktop (please complete the following information):
Additional context
I think it's happning due to next.js overtaking link component and preventing it on click so parent isn't able to detact event
I had this issue, too, but solved it using the onClose property that Menu can pass to its children. For example:
<Menu>
{({ onClose }) => (
<MenuList>
<NextLink>
<MenuItem as="a" onClick={onClose}>
Hello World
</MenuItem>
</NextLink>
</MenuList>
)}
</Menu>
Seems related, I'm finding the menu isn't closing when I click anything other than the menu itself?

ah ok got it, pass down ref!
Most helpful comment
I had this issue, too, but solved it using the
onCloseproperty thatMenucan pass to its children. For example: