Fixed p-trigger conflict

This commit is contained in:
Cagatay Civici
2022-08-24 00:52:27 +03:00
parent 104b40f85a
commit b5a106198e
3 changed files with 10 additions and 6 deletions
+2 -2
View File
@@ -27,7 +27,7 @@ export class AppLayoutComponent implements OnDestroy {
if (!this.menuOutsideClickListener) {
this.menuOutsideClickListener = this.renderer.listen('document', 'click', event => {
const isOutsideClicked = !(this.appSidebar.el.nativeElement.isSameNode(event.target) || this.appSidebar.el.nativeElement.contains(event.target)
|| event.target.classList.contains('p-trigger') || event.target.parentNode.classList.contains('p-trigger'));
|| this.appTopbar.menuButton.nativeElement.isSameNode(event.target) || this.appTopbar.menuButton.nativeElement.contains(event.target));
if (isOutsideClicked) {
this.hideMenu();
@@ -38,7 +38,7 @@ export class AppLayoutComponent implements OnDestroy {
if (!this.profileMenuOutsideClickListener) {
this.profileMenuOutsideClickListener = this.renderer.listen('document', 'click', event => {
const isOutsideClicked = !(this.appTopbar.menu.nativeElement.isSameNode(event.target) || this.appTopbar.menu.nativeElement.contains(event.target)
|| event.target.classList.contains('p-trigger') || event.target.parentNode.classList.contains('p-trigger'));
|| this.appTopbar.topbarMenuButton.nativeElement.isSameNode(event.target) || this.appTopbar.topbarMenuButton.nativeElement.contains(event.target));
if (isOutsideClicked) {
this.hideProfileMenu();