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