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 1cf2f3213..380774e64 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'); }