refactor(nodes): remove flush timing from drag

This commit is contained in:
braks
2022-10-07 22:55:38 +02:00
committed by Braks
parent bf7594fdbb
commit 091c3dff31
+3 -6
View File
@@ -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
}) })