Skip to content

Commit

Permalink
fix: undo & data sync
Browse files Browse the repository at this point in the history
  • Loading branch information
WindRunnerMax committed Apr 5, 2024
1 parent c3ded1c commit 001a382
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 26 deletions.
8 changes: 4 additions & 4 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
"dependencies": {
"@arco-design/web-react": "2.60.3",
"ahooks": "3.7.8",
"doc-editor-core": "1.0.5",
"doc-editor-delta": "1.0.5",
"doc-editor-plugin": "1.0.5",
"doc-editor-utils": "1.0.5",
"doc-editor-core": "1.0.6",
"doc-editor-delta": "1.0.6",
"doc-editor-plugin": "1.0.6",
"doc-editor-utils": "1.0.6",
"react": "17.0.2",
"react-dom": "17.0.2",
"sketching-core": "workspace: *",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ export const Text: FC<{ editor: Editor; state: DeltaState }> = ({ editor, state
() =>
debounce((text: BaseNode[]) => {
dataRef.current = text as BlockElement[];
// fix: 切换面板会重建`Editable`需要更新初始值
richText.init = dataRef.current;
// 双写-空间换时间
// @ts-expect-error BlockElement
if (text.length === 1 && text[0].children.length === 1 && !text[0].children[0].text) {
Expand Down
44 changes: 22 additions & 22 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 001a382

Please sign in to comment.