diff --git a/components/lib/megamenu/MegaMenu.d.ts b/components/lib/megamenu/MegaMenu.d.ts index 710876f5f..d6b64949e 100755 --- a/components/lib/megamenu/MegaMenu.d.ts +++ b/components/lib/megamenu/MegaMenu.d.ts @@ -318,6 +318,29 @@ export interface MegaMenuSlots { */ hasSubmenu: boolean; }): VNode[]; + /** + * Custom menu button template on responsive mode. + * @param {Object} scope - menu button slot's params. + */ + menubutton(scope: { + /** + * Current id state as a string + */ + id: string; + /** + * Style class of component + */ + class: string; + /** + * + * Toggle event + */ + toggleCallback: () => void; + }): VNode[]; + /** + * Custom menu button icon template on responsive mode. + */ + menubuttonicon(): VNode[]; /** * Custom submenu icon template. * @param {Object} scope - submenuicon slot's params. diff --git a/components/lib/megamenu/MegaMenu.vue b/components/lib/megamenu/MegaMenu.vue index ac1854d2d..c0ba7250e 100755 --- a/components/lib/megamenu/MegaMenu.vue +++ b/components/lib/megamenu/MegaMenu.vue @@ -3,24 +3,26 @@
- - - - - + + + + + + + void; + }): VNode[]; /** * Custom popup icon template on responsive mode. + * @deprecated since v3.42.0. Use 'menubuttonicon' slot instead. */ popupicon(): VNode[]; + /** + * Custom menu button icon template on responsive mode. + */ + menubuttonicon(): VNode[]; /** * Custom submenu icon template. * @param {Object} scope - submenuicon slot's params. diff --git a/components/lib/menubar/Menubar.vue b/components/lib/menubar/Menubar.vue index 62420da7a..e90310af2 100755 --- a/components/lib/menubar/Menubar.vue +++ b/components/lib/menubar/Menubar.vue @@ -3,24 +3,26 @@
- - - - - + + + + + + + { - const isOutsideContainer = this.menubar && !this.menubar.contains(event.target); - const isOutsideMenuButton = this.mobileActive && this.$refs.menubutton ? this.$refs.menubutton !== event.target && !this.$refs.menubutton.contains(event.target) : true; + const isOutsideContainer = this.container && !this.container.contains(event.target); + const isOutsideTarget = !(this.target && (this.target === event.target || this.target.contains(event.target))); - if (isOutsideMenuButton && isOutsideContainer) { + if (isOutsideContainer && isOutsideTarget) { this.hide(); } };