diff options
author | Geireann Lindfield Roberts <60007097+geireann@users.noreply.github.com> | 2020-09-21 21:47:46 +0800 |
---|---|---|
committer | Geireann Lindfield Roberts <60007097+geireann@users.noreply.github.com> | 2020-09-21 21:47:46 +0800 |
commit | fd21e351a23b395847da11c3523dbac0038321f3 (patch) | |
tree | 31dedbc9aae622a713bc1ab41c4b8fd6455fe132 /src/fields/util.ts | |
parent | 17f0a7a33fdea46bac50b5cb0d45c9278e41b821 (diff) | |
parent | 6ecfe48643917e5dc774ff39a84c5bef47f0d3b9 (diff) |
Merge branch 'master' into presentation_v1
Diffstat (limited to 'src/fields/util.ts')
-rw-r--r-- | src/fields/util.ts | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/fields/util.ts b/src/fields/util.ts index 9db79ced1..9e5890aa8 100644 --- a/src/fields/util.ts +++ b/src/fields/util.ts @@ -10,6 +10,8 @@ import { DocServer } from "../client/DocServer"; import { ComputedField } from "./ScriptField"; import { ScriptCast, StrCast } from "./Types"; import { returnZero } from "../Utils"; +import CursorField from "./CursorField"; +import { List } from "@material-ui/core"; function _readOnlySetter(): never { @@ -360,10 +362,12 @@ export function updateFunction(target: any, prop: any, value: any, receiver: any const oldValue = current; const newValue = ObjectField.MakeCopy(value); current = newValue; - UndoManager.AddEvent({ - redo() { receiver[prop] = newValue; }, - undo() { receiver[prop] = oldValue; } - }); + if (!(value instanceof CursorField) && !(value?.some((v: any) => v instanceof CursorField))) { + UndoManager.AddEvent({ + redo() { receiver[prop] = newValue; }, + undo() { receiver[prop] = oldValue; } + }); + } } target[Update](diff); }; |