From 78ae5ef8fd10ee6030e977a3e2bb71cf7229e09c Mon Sep 17 00:00:00 2001 From: iamsivin Date: Fri, 9 May 2025 16:53:33 +0530 Subject: [PATCH] chore: Lock context menu --- .../dashboard/components-next/message/Message.vue | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/javascript/dashboard/components-next/message/Message.vue b/app/javascript/dashboard/components-next/message/Message.vue index 1393e262f..7779963fd 100644 --- a/app/javascript/dashboard/components-next/message/Message.vue +++ b/app/javascript/dashboard/components-next/message/Message.vue @@ -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 }; }