When Menu.appendTo is set to a value other than "body" the menu items are not appended to the element passed via template ref, but rather the element is appended to the menu items.
appendOverlay() {
if (this.appendTo) {
if (this.appendTo === 'body') this.renderer.appendChild(this.document.body, this.container);
else appendChild(this.container, this.appendTo);
}
}
Changing the order of the parameters fixes this:
appendOverlay() {
if (this.appendTo) {
if (this.appendTo === 'body') this.renderer.appendChild(this.document.body, this.container);
else appendChild(this.appendTo, this.container);
}
}
This actually appears to be backwards everywhere that the @primeuix/utils version of appendChild is called.
Environment
Fresh download of the v18 branch running the showcase app with a menu added to a button will reproduce this. Personally running on an Apple silicon Mac with node 18.19.1.
Describe the bug
When
Menu.appendTo
is set to a value other than"body"
the menu items are not appended to the element passed via template ref, but rather the element is appended to the menu items.Changing the order of the parameters fixes this:
This actually appears to be backwards everywhere that the @primeuix/utils version of
appendChild
is called.Environment
Fresh download of the
v18
branch running the showcase app with a menu added to a button will reproduce this. Personally running on an Apple silicon Mac with node 18.19.1.Reproducer
https://stackblitz.com/edit/github-l2mr75?file=src%2Fapp%2Fapp.component.html
Angular version
18
PrimeNG version
18.0.0-rc.1
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
18.19.1
Browser(s)
No response
Steps to reproduce the behavior
Menu
component with[appendTo]="someTemplateRef"
menu.ts
to reverse the order of the parameters forappendChild
Expected behavior
Menu items should appear appended to the element passed in via
appendTo