Use VueUse unrefElement

This commit is contained in:
Benjamin Lu
2026-01-23 22:18:31 -08:00
parent 4234e2b50e
commit 2a9e31a5aa

View File

@@ -60,6 +60,7 @@ import {
useDraggable,
useEventListener,
useLocalStorage,
unrefElement,
watchDebounced
} from '@vueuse/core'
import { clamp } from 'es-toolkit/compat'
@@ -101,9 +102,10 @@ const isQueuePanelV2Enabled = computed(() =>
)
const panelRef = ref<ComponentPublicInstance | null>(null)
const panelElement = computed(
() => (panelRef.value?.$el as HTMLElement | undefined) ?? null
)
const panelElement = computed<HTMLElement | null>(() => {
const element = unrefElement(panelRef)
return element instanceof HTMLElement ? element : null
})
const dragHandleRef = ref<HTMLElement | null>(null)
const isDocked = useLocalStorage('Comfy.MenuPosition.Docked', true)
const storedPosition = useLocalStorage('Comfy.MenuPosition.Floating', {