-
Notifications
You must be signed in to change notification settings - Fork 593
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
dropdown not hide after click if use "to" prop for item #899
Comments
Hi, I have the same issue with reproduction here: https://stackblitz.com/edit/nuxt-ui-eomajj?file=app.vue I'm not sure where the issue comes from. As soon as the <NuxtLink to="/" @click="console.log('click')">
Trigger the click event
</NuxtLink>
<HMenuItem>
<NuxtLink to="/" @click="console.log('click')">
Doesn't trigger the click event
</NuxtLink>
</HMenuItem> I think this is related to this issue: tailwindlabs/headlessui#143 (comment) The only workaround I found is to wrap the <NuxtLink v-slot="{ href, navigate }" to="/" custom>
<HMenuItem v-slot="{ close }">
<a :href="href" @click.prevent="[navigate(), close()]">...</a>
</HMenuItem>
</NuxtLink> |
same issue, dropdown not closed after click menu in mobile nav menu. what the solution for this? |
@narr07 For now as a workaround I use the function to navigate: |
@flozdra Thanks! I've implemented your suggestion and it seems to finally fix the issue 😊 |
Environment
Nuxt 3.7.4 with Nitro 2.7.2
Version
v2.10.0
Reproduction
Not have
Description
Dropdown not hide after click, if use in header dropdown with
links
dropdown not hide after clickAdditional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: