isaacplmann / ngx-contextmenu

An Angular component to show a context menu on an arbitrary component
MIT License
248 stars 91 forks source link

Duplicate container with Angular Material #206

Closed ALapaque closed 4 years ago

ALapaque commented 4 years ago

Describe the bug A clear and concise description of what the bug is.

The issue is when I'm adding your package to my project the dom inject a new container "cdk-overlay-container" in the dom when I navigate to different components within module. And with Angular Material we're using these containers to set a class for theming. I guess it comes from your package because if I remove it the container is never duplicated and theming works perfectly.

I've made a repo for you to test this https://github.com/ALapaque/dyma-cocktails/tree/issues/contextMenu

bug-ngx-contextMenu

To Reproduce Steps to reproduce the behavior:

  1. Click on 'Acheter'
  2. Click on 'button next to Cocktails and go to panier'
  3. Right click on an element of the list
  4. See the DOM contains now 2
    one with the class theme and one without

Expected behavior A clear and concise description of what you expected to happen. We should have only one container as before I tested it on angular 7 and it was working fine

Stackblitz Example Please use this https://github.com/ALapaque/dyma-cocktails/tree/issues/contextMenu

ALapaque commented 4 years ago

UPDATE :

If I rollback to the version 5.3.0 it works fine