isaacplmann / ngx-contextmenu

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

Contextmenu doesn't show in modal #113

Closed yorre92 closed 6 years ago

yorre92 commented 6 years ago

I want to use the context menu when i have a modal open.

But the menu appears underneath the modal.

I've tried adding this css.

.ngx-contextmenu > .dropdown-menu {
    position: absolute;
    background-color: yellow;
    z-index: 1060;
  }

Color changes but it still appears underneath.

Im using ngx-bootstrap modal

yorre92 commented 6 years ago

Found a fix.

Issue was that the cdk-overlay was behind the modal.

.cdk-global-overlay-wrapper, .cdk-overlay-container {
  z-index: 99999 !important;
}

This code solved the issue.

fromage9747 commented 6 years ago

@isaacplmann thanks for this. I ran into the same issue. First I placed the CSS in the route CSS file of the component where I was using the context menu but it didn't work.

Once I placed it in the main styles.css it worked a treat!

nehaakhandelwal commented 1 year ago

@yorre92 @fromage9747 @isaacplmann Do you have any idea how to prevent context menu to not go outside modal-content window? I have tried something but it works 1 out of 5 times.

PS - It is not related to any package, I created ,my own component and want to resolve this