From ff0918522b5bf25493270b12b2dfe2d1999837c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20=C3=87etin?= <92744169+mehmetcetin01140@users.noreply.github.com> Date: Fri, 22 Nov 2024 15:42:38 +0300 Subject: [PATCH] Fixed #16559 | p-buttonGroup throws console errors when styleClass is applied --- packages/primeng/src/styleclass/styleclass.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/primeng/src/styleclass/styleclass.ts b/packages/primeng/src/styleclass/styleclass.ts index 45e8a47f06..ef1e566635 100644 --- a/packages/primeng/src/styleclass/styleclass.ts +++ b/packages/primeng/src/styleclass/styleclass.ts @@ -116,7 +116,7 @@ export class StyleClass implements OnDestroy { if (this.toggleClass) { this.toggle(); } else { - if ((this.target as HTMLElement).offsetParent === null) this.enter(); + if ((this.target as HTMLElement)?.offsetParent === null) this.enter(); else this.leave(); } }