chore: Minor fix

This commit is contained in:
iamsivin
2025-05-23 14:02:13 +05:30
parent d3e3809118
commit 2e6998e57a
4 changed files with 10 additions and 20 deletions
@@ -5,6 +5,7 @@ import {
nextTick,
onUnmounted,
useTemplateRef,
inject,
} from 'vue';
import { useWindowSize, useElementBounding, useScrollLock } from '@vueuse/core';
@@ -13,14 +14,18 @@ import TeleportWithDirection from 'dashboard/components-next/TeleportWithDirecti
const props = defineProps({
x: { type: Number, default: 0 },
y: { type: Number, default: 0 },
scrollLockElement: { type: [HTMLElement, null], default: null },
});
const emit = defineEmits(['close']);
const elementToLock = inject('contextMenuElementTarget', null);
const menuRef = useTemplateRef('menuRef');
const scrollLockElement = computed(() => props.scrollLockElement);
const scrollLockElement = computed(() => {
if (!elementToLock?.value) return null;
return elementToLock.value.$el;
});
const isLocked = useScrollLock(scrollLockElement);