Menubar mobile outside click defect
parent
73375d1555
commit
53f1a6973e
|
@ -134,7 +134,7 @@ export default {
|
||||||
ZIndexUtils.set('menu', this.menubar, this.$primevue.config.zIndex.menu);
|
ZIndexUtils.set('menu', this.menubar, this.$primevue.config.zIndex.menu);
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.show();
|
this.show();
|
||||||
}, 0);
|
}, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.bindOutsideClickListener();
|
this.bindOutsideClickListener();
|
||||||
|
@ -147,6 +147,7 @@ export default {
|
||||||
},
|
},
|
||||||
hide(event, isFocus) {
|
hide(event, isFocus) {
|
||||||
if (this.mobileActive) {
|
if (this.mobileActive) {
|
||||||
|
this.mobileActive = false;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
DomHandler.focus(this.$refs.menubutton);
|
DomHandler.focus(this.$refs.menubutton);
|
||||||
}, 0);
|
}, 0);
|
||||||
|
@ -419,8 +420,8 @@ export default {
|
||||||
const isOutsideContainer = this.menubar !== event.target && !this.menubar.contains(event.target);
|
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 isOutsideMenuButton = this.mobileActive && this.$refs.menubutton !== event.target && !this.$refs.menubutton.contains(event.target);
|
||||||
|
|
||||||
if (isOutsideContainer) {
|
if (isOutsideMenuButton && isOutsideContainer) {
|
||||||
isOutsideMenuButton ? (this.mobileActive = false) : this.hide();
|
this.hide();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue