diff options
-rw-r--r-- | src/client/documents/Documents.ts | 1 | ||||
-rw-r--r-- | src/client/views/collections/CollectionStackingViewFieldColumn.tsx | 9 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts index 88f48488a..c0f0e0552 100644 --- a/src/client/documents/Documents.ts +++ b/src/client/documents/Documents.ts @@ -707,6 +707,7 @@ export namespace Docs { layout = FormattedTextBox.LayoutString; } created.layout = layout?.(fieldKey); + created.title = fieldKey; proto && (created.proto = Doc.GetProto(proto)); return created; } diff --git a/src/client/views/collections/CollectionStackingViewFieldColumn.tsx b/src/client/views/collections/CollectionStackingViewFieldColumn.tsx index 5a919c2bc..249d3de68 100644 --- a/src/client/views/collections/CollectionStackingViewFieldColumn.tsx +++ b/src/client/views/collections/CollectionStackingViewFieldColumn.tsx @@ -140,16 +140,15 @@ export class CollectionStackingViewFieldColumn extends React.Component<CSVFieldC } else if (value.startsWith(":")) { const { Document, addDocument } = this.props.parent.props; const fieldKey = value.substring(1); - const proto = Doc.GetProto(Document); - const dataDoc = this.props.parent.props.DataDoc || this.props.parent.dataDoc; - const created = Docs.Get.DocumentFromField(dataDoc, fieldKey, proto); + const dataDoc = this.props.parent.props.DataDoc || this.props.parent.Document; + const created = Docs.Get.DocumentFromField(dataDoc, fieldKey, Doc.GetProto(Document)); if (created) { - created.title = fieldKey; if (this.props.parent.Document.isTemplateDoc) { Doc.MakeMetadataFieldTemplate(created, this.props.parent.props.Document); } + return addDocument(created); } - return created ? addDocument(created) : false; + return false; } this._createAliasSelected = false; const key = StrCast(this.props.parent.props.Document.sectionFilter); |