From cde8c07055de5718e263b33c891173f00ac5b039 Mon Sep 17 00:00:00 2001 From: Wanderley Teixeira Date: Thu, 15 Aug 2024 11:42:01 -0300 Subject: [PATCH] fix(menu): ajusta quando menu instanciado como componente MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ajusta o comportamento do menu quando o mesmo estiver instanciado como um componente da aplicação, permitindo que o componente de página, ocupe o espaço liberado pelo componente de menu, quando estiver retraído Fixes #2183 --- projects/ui/src/lib/components/po-menu/po-menu.component.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/projects/ui/src/lib/components/po-menu/po-menu.component.ts b/projects/ui/src/lib/components/po-menu/po-menu.component.ts index 1cf2f32130..380774e642 100644 --- a/projects/ui/src/lib/components/po-menu/po-menu.component.ts +++ b/projects/ui/src/lib/components/po-menu/po-menu.component.ts @@ -317,7 +317,8 @@ export class PoMenuComponent extends PoMenuBaseComponent implements AfterViewIni } protected validateCollapseClass(collapsedMobile: boolean = false) { - const wrapper = this.element.nativeElement.parentNode; + const wrapper = this.element.nativeElement.closest('.po-wrapper') || this.element.nativeElement.parentNode; + this.renderer[this.isCollapsed && !collapsedMobile ? 'addClass' : 'removeClass'](wrapper, 'po-collapsed-menu'); }