From 0ae04152c16344387c3ef60bf41634898f0f9eff Mon Sep 17 00:00:00 2001 From: cagataycivici Date: Fri, 15 May 2020 18:31:05 +0300 Subject: [PATCH] Close menu on leaf click --- src/components/menubar/Menubar.vue | 5 ++++- src/components/menubar/MenubarSub.vue | 5 +---- src/components/tieredmenu/TieredMenuSub.vue | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/menubar/Menubar.vue b/src/components/menubar/Menubar.vue index c4e9e2a0a..1f33b2461 100755 --- a/src/components/menubar/Menubar.vue +++ b/src/components/menubar/Menubar.vue @@ -6,7 +6,7 @@
- +
@@ -61,6 +61,9 @@ export default { this.outsideClickListener = null; } }, + onLeafClick() { + this.mobileActive = false; + } }, computed: { containerClass() { diff --git a/src/components/menubar/MenubarSub.vue b/src/components/menubar/MenubarSub.vue index dd875772b..52b2d6763 100755 --- a/src/components/menubar/MenubarSub.vue +++ b/src/components/menubar/MenubarSub.vue @@ -116,10 +116,7 @@ export default { }, onLeafClick() { this.activeItem = null; - - if (!this.root) { - this.$emit('leaf-click'); - } + this.$emit('leaf-click'); }, onItemKeyDown(event, item) { let listItem = event.currentTarget.parentElement; diff --git a/src/components/tieredmenu/TieredMenuSub.vue b/src/components/tieredmenu/TieredMenuSub.vue index a9f829b72..7f2c61be3 100755 --- a/src/components/tieredmenu/TieredMenuSub.vue +++ b/src/components/tieredmenu/TieredMenuSub.vue @@ -99,7 +99,7 @@ export default { }); } - if (this.root && item.items) { + if (item.items) { if (this.activeItem && item === this.activeItem) this.activeItem = null; else