From 53f1a6973e449ddd9dbe533b125519edc1135096 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tu=C4=9F=C3=A7e=20K=C3=BC=C3=A7=C3=BCko=C4=9Flu?= Date: Tue, 4 Jul 2023 17:11:19 +0300 Subject: [PATCH] Menubar mobile outside click defect --- components/lib/menubar/Menubar.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/components/lib/menubar/Menubar.vue b/components/lib/menubar/Menubar.vue index 0fad2bce7..9a49711dd 100755 --- a/components/lib/menubar/Menubar.vue +++ b/components/lib/menubar/Menubar.vue @@ -134,7 +134,7 @@ export default { ZIndexUtils.set('menu', this.menubar, this.$primevue.config.zIndex.menu); setTimeout(() => { this.show(); - }, 0); + }, 1); } this.bindOutsideClickListener(); @@ -147,6 +147,7 @@ export default { }, hide(event, isFocus) { if (this.mobileActive) { + this.mobileActive = false; setTimeout(() => { DomHandler.focus(this.$refs.menubutton); }, 0); @@ -419,8 +420,8 @@ export default { const isOutsideContainer = this.menubar !== event.target && !this.menubar.contains(event.target); const isOutsideMenuButton = this.mobileActive && this.$refs.menubutton !== event.target && !this.$refs.menubutton.contains(event.target); - if (isOutsideContainer) { - isOutsideMenuButton ? (this.mobileActive = false) : this.hide(); + if (isOutsideMenuButton && isOutsideContainer) { + this.hide(); } };