chore: Lock context menu

This commit is contained in:
iamsivin
2025-05-09 16:53:33 +05:30
parent 0c5379147d
commit 78ae5ef8fd
@@ -19,6 +19,7 @@ import {
MESSAGE_STATUS,
CONTENT_TYPES,
} from './constants';
import { useGlobalScrollLock } from 'dashboard/composables/useGlobalScrollLock';
import Avatar from 'next/avatar/Avatar.vue';
@@ -130,6 +131,7 @@ const props = defineProps({
sourceId: { type: String, default: '' }, // eslint-disable-line vue/no-unused-properties
});
const conversationPanelScrollLock = useGlobalScrollLock();
const contextMenuPosition = ref({});
const showBackgroundHighlight = ref(false);
const showContextMenu = ref(false);
@@ -368,6 +370,9 @@ const shouldRenderMessage = computed(() => {
});
function openContextMenu(e) {
// Lock scroll to prevent scrolling when context menu is open
conversationPanelScrollLock.lockScroll('.conversation-panel');
// Close forward modal, when opening context menu
emailBubbleRef.value?.closeForwardModal();
@@ -390,6 +395,8 @@ function openContextMenu(e) {
}
function closeContextMenu() {
// Unlock scroll when context menu is closed
conversationPanelScrollLock.unlockScroll();
showContextMenu.value = false;
contextMenuPosition.value = { x: null, y: null };
}