PerfectMemory / ngx-contextmenu

A context menu component for Angular
https://perfectmemory.github.io/ngx-contextmenu
MIT License
42 stars 12 forks source link

Submenu is rendered in wrong place #3

Closed Timmeeeey closed 2 years ago

Timmeeeey commented 2 years ago

Describe the bug If you use html in an item template with submenu and click on the menu item text then the submenu is rendered in the wrong place.

Example:

<ng-template contextMenuItem [subMenu]="subMenu">
  <div>Item</div>
</ng-template>

Stackblitz Example https://stackblitz.com/edit/angular-ivy-zcbqgj

image

sroucheray commented 2 years ago

Hi @Timmeeeey,

Thanks for the details. I think this might be because the menu has not enough space on the right to show itself, so it auto positions where it can and where it's best.

If I give it enough horizontal space on its right, I get this on your stackblitz :

On Firefox: image

On Chrome: image

Could you check again and confirm please ?

Timmeeeey commented 2 years ago

Yes there is enough space. Did you click on the text "Item 2"? 2022-05-18_08h59_14

sroucheray commented 2 years ago

Fixed in 8.0.1. Thanks for the report @Timmeeeey ! https://stackblitz.com/edit/angular-ivy-njp6pu?file=angular.json