diff options
-rw-r--r-- | src/client/views/collections/collectionSchema/SchemaTableCell.tsx | 2 | ||||
-rw-r--r-- | src/fields/RichTextField.ts | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/client/views/collections/collectionSchema/SchemaTableCell.tsx b/src/client/views/collections/collectionSchema/SchemaTableCell.tsx index ce73ff8a4..67dc508d5 100644 --- a/src/client/views/collections/collectionSchema/SchemaTableCell.tsx +++ b/src/client/views/collections/collectionSchema/SchemaTableCell.tsx @@ -141,7 +141,7 @@ export class SchemaTableCell extends ObservableReactComponent<SchemaTableCellPro this._props.finishEdit?.(); return true; } - const ret = KeyValueBox.SetField(this._props.Document, this._props.fieldKey.replace(/^_/, ''), value, Doc.IsDataProto(this._props.Document) ? true : undefined); + const ret = this.selected && KeyValueBox.SetField(this._props.Document, this._props.fieldKey.replace(/^_/, ''), value, Doc.IsDataProto(this._props.Document) ? true : undefined); this._props.finishEdit?.(); return ret; }, 'edit schema cell')} diff --git a/src/fields/RichTextField.ts b/src/fields/RichTextField.ts index 50cfab988..855b63d4b 100644 --- a/src/fields/RichTextField.ts +++ b/src/fields/RichTextField.ts @@ -31,7 +31,7 @@ export class RichTextField extends ObjectField { return '`' + this.Text + '`'; } [ToScriptString]() { - return `new RichTextField("${this.Data.replace(/"/g, '\\"')}", "${this.Text}")`; + return `new RichTextField("${this.Data?.replace(/"/g, '\\"')}", "${this.Text}")`; } [ToString]() { return this.Text; |