twentyhq / twenty

Building a modern alternative to Salesforce, powered by the community.
https://twenty.com
Other
17.88k stars 2.11k forks source link

The dragged block gets appended to the body on dragging #6724

Closed ehconitin closed 1 month ago

ehconitin commented 2 months ago

Bug Description

When dragging a block in the editor, the block is appending to the body.

https://github.com/user-attachments/assets/fb00a63e-9b43-46d3-9c68-8c156b44b551

Expected behavior

The block should not clutter the body upon being dragged.

Technical inputs

This issue is caused by setActivityBody(newStringifiedBody) in the handleEditorChange function within the RichTextEditor component, which triggers re-renders causing the issue. Relevant Code

Proposed Solutions

I have identified two potential solutions which works:

Which one should I go ahead with?

charlesBochet commented 2 months ago

Weird one, I think we can get it right, re-renders should not matter