Skip to content

Commit

Permalink
Merge pull request #14102 from hugograf/master
Browse files Browse the repository at this point in the history
Fix: #14006 - 16.7.0: Context Menu with appendTo="body" throws Type Error in a nested Table
  • Loading branch information
cetincakiroglu authored Nov 21, 2023
2 parents 3003af5 + e4f6754 commit 4b9446f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/app/components/contextmenu/contextmenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1150,8 +1150,13 @@ export class ContextMenu implements OnInit, AfterContentInit, OnDestroy {

removeAppendedElements() {
if (this.appendTo) {
if (this.appendTo === 'body') this.renderer.removeChild(this.document.body, this.containerViewChild.nativeElement);
else DomHandler.removeChild(this.containerViewChild.nativeElement, this.appendTo);
if (this.appendTo === 'body') {
if(this.containerViewChild) {
this.renderer.removeChild(this.document.body, this.containerViewChild.nativeElement);
}
} else {
DomHandler.removeChild(this.containerViewChild.nativeElement, this.appendTo);
}
}
}

Expand Down

1 comment on commit 4b9446f

@vercel
Copy link

@vercel vercel bot commented on 4b9446f Nov 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.