Skip to content

Commit

Permalink
fix(menu): ajusta quando menu instanciado como componente
Browse files Browse the repository at this point in the history
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 po-ui#2183
  • Loading branch information
wsteixeira committed Aug 15, 2024
1 parent e215947 commit 4bd00cf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion projects/ui/src/lib/components/po-menu/po-menu.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand Down

0 comments on commit 4bd00cf

Please sign in to comment.