Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Report]: dynamic-group extension separate with its children when quick drag and release #1911

Open
irelance opened this issue Oct 16, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@irelance
Copy link

What happened?

small.mp4

Core Version

2.0.6

Extension Version

2.0.10

Engine Version

No response

What browsers are you seeing the problem on?

Firefox, Chrome, Microsoft Edge

@irelance irelance added the bug Something isn't working label Oct 16, 2024
@boyongjiong
Copy link
Collaborator

😂😂 I have not reproduced this problem. Is there a similar problem in all kinds of browsers? or some of them
2024-10-30 15 45 59

@irelance
Copy link
Author

You need to quick drag and release to trigger this bug.
Your gif is only dragging. (you need to release your Left Mouse Button)
Yes, all of them (I don't know if safari has this problem, because I don't have mac).

@irelance
Copy link
Author

Watch my video between 0:27 ~ 0:29, I click LMB (Left Mouse Button) start to drag and release LMB for 4 times.

@irelance
Copy link
Author

Besides, If you use custom htmlnode this bug will become more obvious.

@wbccb
Copy link
Contributor

wbccb commented Nov 15, 2024

I also found this problem, it should be the same problem #1949

DynamicGroup's parent movement is handled internally by onDragging()
The movement of DynamicGroup's children is handled by MOUSEMOVE's dx and dy

Promise.resolve().then(() => {
  this.onDragging({
    deltaX,
    deltaY,
    event: e,
  })
  this.eventCenter?.emit(EventType[`${this.eventType}_MOUSEMOVE`], {
    deltaX,
    deltaY,
    e,
    data: this.data || elementData,
  })
  this.eventCenter?.emit(EventType[`${this.eventType}_DRAG`], {
    e,
    data: this.data || elementData,
  })
})

onDragging() uses event data to calculate dx and dy, which has a slight error with the final dx and dy of mousemove, causing the position movement of parent and children to be slightly disordered

Of course, autoExpand is another problem, the dx and dy changed by onDragging() are larger


  • onDragging()->parent moveNodes()
  • MOUSEMOVE event-> children moveNodes()

The unification of the dx and dy data of parent.moveNodes() and the dx and dy data emitted by the mousemove event should be the key point to approach this problem.

@ZivvW
Copy link

ZivvW commented Nov 20, 2024

I also found this problem, it should be the same problem #1949

DynamicGroup's parent movement is handled internally by onDragging() The movement of DynamicGroup's children is handled by MOUSEMOVE's dx and dy

Promise.resolve().then(() => {
  this.onDragging({
    deltaX,
    deltaY,
    event: e,
  })
  this.eventCenter?.emit(EventType[`${this.eventType}_MOUSEMOVE`], {
    deltaX,
    deltaY,
    e,
    data: this.data || elementData,
  })
  this.eventCenter?.emit(EventType[`${this.eventType}_DRAG`], {
    e,
    data: this.data || elementData,
  })
})

onDragging() uses event data to calculate dx and dy, which has a slight error with the final dx and dy of mousemove, causing the position movement of parent and children to be slightly disordered

Of course, autoExpand is another problem, the dx and dy changed by onDragging() are larger

  • onDragging()->parent moveNodes()
  • MOUSEMOVE event-> children moveNodes()

The unification of the dx and dy data of parent.moveNodes() and the dx and dy data emitted by the mousemove event should be the key point to approach this problem.

maybe can fix in #1963
getMoveDistance can get parent real dx and dy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants
@irelance @boyongjiong @ZivvW @wbccb and others