pull/5189/head
mohit-nagaraj 3 months ago
parent da831893de
commit e2ce0e38a6
No known key found for this signature in database

@ -42,6 +42,18 @@ export default {
mounted() {
this.modal = new Modal(this.$refs.modal);
},
watch: {
$route(to, from) {
this.cleanupModal();
}
},
beforeUnmount() {
this.cleanupModal();
},
beforeRouteLeave(to, from, next) {
this.cleanupModal();
next();
},
methods: {
/**
* Show the confirm dialog
@ -58,6 +70,22 @@ export default {
this.$emit("added", this.groupName);
this.modal.hide();
},
/**
* Clean up modal and restore scroll behavior
* @returns {void}
*/
cleanupModal() {
if (this.modal) {
try {
this.modal.hide();
} catch (e) {
console.warn("Modal hide failed:", e);
}
}
document.body.classList.remove('modal-open');
document.body.style.paddingRight = '';
document.body.style.overflow = '';
}
},
};
</script>

@ -354,8 +354,11 @@ export default {
*/
cleanupModal() {
if (this.modal) {
this.modal.hide();
this.modal.dispose();
try {
this.modal.hide();
} catch (e) {
console.warn("Modal hide failed:", e);
}
}
document.body.classList.remove('modal-open');
document.body.style.paddingRight = '';

@ -231,8 +231,11 @@ export default {
*/
cleanupModal() {
if (this.modal) {
this.modal.hide();
this.modal.dispose();
try {
this.modal.hide();
} catch (e) {
console.warn("Modal hide failed:", e);
}
}
document.body.classList.remove('modal-open');
document.body.style.paddingRight = '';

@ -248,6 +248,20 @@ export default {
this.modal = new Modal(this.$refs.modal);
this.getExistingTags();
},
beforeRouteLeave(to, from, next) {
this.cleanupModal();
next();
},
watch: {
$route(to, from) {
this.cleanupModal();
}
},
beforeUnmount() {
this.cleanupModal();
},
methods: {
/**
* Show the add tag dialog
@ -459,6 +473,22 @@ export default {
this.newTags = [];
this.deleteTags = [];
this.processing = false;
},
/**
* Clean up modal and restore scroll behavior
* @returns {void}
*/
cleanupModal() {
if (this.modal) {
try {
this.modal.hide();
} catch (e) {
console.warn("Modal hide failed:", e);
}
}
document.body.classList.remove('modal-open');
document.body.style.paddingRight = '';
document.body.style.overflow = '';
}
},
};

Loading…
Cancel
Save