Skip to content

Problem with context menu inside a component that is used multiple times on the same page #162

@rrrnix

Description

@rrrnix

Describe the bug
When you add the ContextMenu to a component, and you use this component multiple times on the same page, the context menu does work not anymore. Is shows, but click events and submenu's stop working.

To Reproduce
Steps to reproduce the behavior:
create a new component, add a ContextMenu to it, add the component to a web page. All works fine
Add the same component again to the same webpage, and the ContextMenu stops working.

Expected behavior
The ContextMenu works as well if multiple instances of the same component are on a page

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • Windows 11 Pro
  • Edge
  • 24H2

Additional context

It seems that the problem is in the fact that the ContextMenu uses the ContextMenu.Id for reference, and the 2 instances of the component have the same Id.

As a workaround, you can use a variable for the ContextMenu.Id and assign a unique value to it for the different instances of your component

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions