From 4f03bbfac24b14cb189f1c3dbe51cd596a447fa3 Mon Sep 17 00:00:00 2001 From: Hugo Graf Date: Mon, 13 Nov 2023 20:13:04 +0100 Subject: [PATCH] Fix: #14006 - 16.7.0: Context Menu with appendTo="body" throws Type Error in a nested Table --- src/app/components/contextmenu/contextmenu.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app/components/contextmenu/contextmenu.ts b/src/app/components/contextmenu/contextmenu.ts index 591a98b66bf..445e60d9240 100755 --- a/src/app/components/contextmenu/contextmenu.ts +++ b/src/app/components/contextmenu/contextmenu.ts @@ -1150,13 +1150,13 @@ export class ContextMenu implements OnInit, AfterContentInit, OnDestroy { removeAppendedElements() { if (this.appendTo) { - if (this.appendTo === 'body') { - if(this.containerViewChild) { + if (this.appendTo === 'body') { + if(this.containerViewChild) { this.renderer.removeChild(this.document.body, this.containerViewChild.nativeElement); - } - } else { - DomHandler.removeChild(this.containerViewChild.nativeElement, this.appendTo); - } + } + } else { + DomHandler.removeChild(this.containerViewChild.nativeElement, this.appendTo); + } } }