Skip to content

Commit

Permalink
fix: useDebouncedCellData does not partially update and instead does …
Browse files Browse the repository at this point in the history
…a full data update

this was an unintentional bug as there was too much focus on the slate case

fixes #1278
  • Loading branch information
macrozone committed Feb 13, 2023
1 parent 3ef3395 commit 0273dd5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/editor/src/core/components/hooks/node.ts
Expand Up @@ -393,6 +393,7 @@ export const useDebouncedCellData = (nodeId: string) => {
currentPartialDataRef.current = {
...(currentPartialDataRef.current ?? {}),
[lang]: {
...(cellData ?? {}),
...(currentPartialDataRef.current?.[lang] ?? {}),
...(partialData ?? {}),
},
Expand All @@ -411,7 +412,7 @@ export const useDebouncedCellData = (nodeId: string) => {
delete updateHandles.current[lang];
}, 200);
},
[updateCellDataImmediatly, currentLang, currentPartialData]
[updateCellDataImmediatly, currentLang, cellData]
);

return [currentData, onChange] as const;
Expand Down

0 comments on commit 0273dd5

Please sign in to comment.