diff options
author | usodhi <61431818+usodhi@users.noreply.github.com> | 2020-09-21 09:48:05 +0530 |
---|---|---|
committer | usodhi <61431818+usodhi@users.noreply.github.com> | 2020-09-21 09:48:05 +0530 |
commit | 1b43981511136d9b68a1014906a1c409a6831fc6 (patch) | |
tree | 9591c124db7d9d4499724d734661dbba95183ecf /src/fields/util.ts | |
parent | a453df4d9df855243005b83d8b1015c17d74d034 (diff) | |
parent | e4ae6fa6df6bb0118f113bbdf3a40f768405f7b3 (diff) |
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into acls_uv
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); }; |