chore: Lock context menu
This commit is contained in:
@@ -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 };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user