refactor(nodes): remove flush timing from drag
This commit is contained in:
@@ -21,6 +21,7 @@ interface UseDragParams {
|
|||||||
|
|
||||||
function useDrag(params: UseDragParams) {
|
function useDrag(params: UseDragParams) {
|
||||||
const scope = effectScope()
|
const scope = effectScope()
|
||||||
|
|
||||||
const dragging = scope.run(() => {
|
const dragging = scope.run(() => {
|
||||||
const {
|
const {
|
||||||
viewport,
|
viewport,
|
||||||
@@ -62,9 +63,7 @@ function useDrag(params: UseDragParams) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(
|
watch([() => disabled, () => el], () => {
|
||||||
[() => disabled, () => el],
|
|
||||||
() => {
|
|
||||||
if (el) {
|
if (el) {
|
||||||
const selection = select(el)
|
const selection = select(el)
|
||||||
const node = id ? getNode(id) : undefined
|
const node = id ? getNode(id) : undefined
|
||||||
@@ -155,9 +154,7 @@ function useDrag(params: UseDragParams) {
|
|||||||
selection.call(dragHandler)
|
selection.call(dragHandler)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
})
|
||||||
{ flush: 'post' },
|
|
||||||
)
|
|
||||||
|
|
||||||
return dragging
|
return dragging
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user