-
-
Notifications
You must be signed in to change notification settings - Fork 262
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
ContextMenu can only be used on the whole page #620
Comments
I agree that there should be an option to use it on an arbitrary element. I think that adding a |
I guess that would work for most cases, but I'm not sure that would be flexible enough. I think this would be a sane change for |
Should just be called |
I also don't understand why ContextMenu is indeed not contextualized based on what item you right-click. Please at least populate the passed on:open forwarded event with a reference to the DOM element we have the cursor over. <ContextMenu on:open={(...e)=>{console.log(e); }}>
<ContextMenuOption indented labelText="Copy"/>
<ContextMenuOption indented kind="danger" labelText="Delete" />
</ContextMenu> |
In version 0.50, you can now pass custom elements as trigger targets to Example: https://carbon-components-svelte.onrender.com/components/ContextMenu#custom-target @Trystan-SA The <ContextMenu on:open={(e) => {
console.log(e.detail); // HTMLElement
}}>
...
</ContextMenu> |
Currently,
ContextMenu
can only be used on the whole page.Sadly, this is pretty limiting - I'd like to use it only on an element on my page.
Could
ContextMenu
be split into a dumb sub-component which doesn't listen for events itself?I would like to just give it
x
,y
as props and handle everything else myself.The text was updated successfully, but these errors were encountered: