Skip to content

Commit

Permalink
added timeout to avoid appending of blocks (#6725)
Browse files Browse the repository at this point in the history
@FelixMalfait
fixes #6724  
Thanks :)

---------

Co-authored-by: Lucas Bordeau <[email protected]>
  • Loading branch information
ehconitin and lucasbordeau authored Sep 6, 2024
1 parent e288205 commit 7a8d46a
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -256,10 +256,16 @@ export const RichTextEditor = ({

const handleBodyChangeDebounced = useDebouncedCallback(handleBodyChange, 500);

// See https://github.com/twentyhq/twenty/issues/6724 for explanation
const setActivityBodyDebouncedToAvoidDragBug = useDebouncedCallback(
setActivityBody,
100,
);

const handleEditorChange = () => {
const newStringifiedBody = JSON.stringify(editor.document) ?? '';

setActivityBody(newStringifiedBody);
setActivityBodyDebouncedToAvoidDragBug(newStringifiedBody);

handleBodyChangeDebounced(newStringifiedBody);
};
Expand Down

0 comments on commit 7a8d46a

Please sign in to comment.