aboutsummaryrefslogtreecommitdiff
path: root/src/fields/util.ts
diff options
context:
space:
mode:
authorGeireann Lindfield Roberts <60007097+geireann@users.noreply.github.com>2020-09-21 21:47:46 +0800
committerGeireann Lindfield Roberts <60007097+geireann@users.noreply.github.com>2020-09-21 21:47:46 +0800
commitfd21e351a23b395847da11c3523dbac0038321f3 (patch)
tree31dedbc9aae622a713bc1ab41c4b8fd6455fe132 /src/fields/util.ts
parent17f0a7a33fdea46bac50b5cb0d45c9278e41b821 (diff)
parent6ecfe48643917e5dc774ff39a84c5bef47f0d3b9 (diff)
Merge branch 'master' into presentation_v1
Diffstat (limited to 'src/fields/util.ts')
-rw-r--r--src/fields/util.ts12
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);
};