mirror of
https://github.com/twentyhq/twenty.git
synced 2024-12-27 22:32:49 +03:00
added timeout to avoid appending of blocks (#6725)
@FelixMalfait fixes #6724 Thanks :) --------- Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
This commit is contained in:
parent
e2882056a9
commit
7a8d46a51d
@ -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);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user