-
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
fix(Dropdown): close on click item with to
#103
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
✅ Deploy Preview for nuxthq-ui canceled.
|
@@ -151,6 +151,8 @@ function onItemClick (e, item: any) { | |||
|
|||
if (item.click) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does it closes here without doing your change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In any case, except with to
, Menu
closes on item click.
When to
is defined, Menu
click handling is disrupted (not sure why tho), that's why we need a manual closing.
ℹ️ If there are no to
or click
props, the Menu
closes on item click.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should try to investigate why the click is disrupted? Maybe NuxtLink
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is NuxtLink for sure. and this is not the first time we encouter issues around this. Preventing default from click of a NuxtLink or stopping the bubbling are still a struggle. Let me find an old PR with something like that.
Still investigating on this |
@larbish Since you use UI, from now on you should consider any event passed to a dropdown item click handler as protentially const dropdownItems = [
[{
label: 'Edit',
icon: 'heroicons-solid:pencil',
click: (e) => {
e?.preventDefault()
}
}]
] Event is null on keyboard |
Fixes #98
Fixes #106