fix(core): use computed var to get node in drag handler
Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
@@ -42,12 +42,13 @@ function useDrag(params: UseDragParams) {
|
||||
let lastPos = $ref<Partial<XYPosition>>({ x: undefined, y: undefined })
|
||||
let dragHandler = $ref<any>()
|
||||
|
||||
const node = $computed(() => (id ? findNode(id) : undefined))
|
||||
|
||||
const getPointerPosition = useGetPointerPosition()
|
||||
|
||||
watch([() => disabled, () => el], () => {
|
||||
if (el) {
|
||||
const selection = select(el)
|
||||
const node = id ? findNode(id) : undefined
|
||||
|
||||
if (disabled) {
|
||||
selection.on('.drag', null)
|
||||
|
||||
Reference in New Issue
Block a user