Fixed #4405 - Menubar - clicking outside of submenu should hide it

pull/4409/head
Tuğçe Küçükoğlu 2023-09-07 14:49:11 +03:00
parent 6b1b47939f
commit fd51e4226e
1 changed files with 2 additions and 2 deletions

View File

@ -423,8 +423,8 @@ export default {
bindOutsideClickListener() {
if (!this.outsideClickListener) {
this.outsideClickListener = (event) => {
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);
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;
if (isOutsideMenuButton && isOutsideContainer) {
this.hide();