aboutsummaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
Diffstat (limited to 'src/client')
-rw-r--r--src/client/views/DocComponent.tsx4
-rw-r--r--src/client/views/collections/CollectionSubView.tsx4
-rw-r--r--src/client/views/nodes/DocumentContentsView.tsx2
-rw-r--r--src/client/views/nodes/FieldView.tsx2
4 files changed, 7 insertions, 5 deletions
diff --git a/src/client/views/DocComponent.tsx b/src/client/views/DocComponent.tsx
index 8f254ddcd..3a868d1f9 100644
--- a/src/client/views/DocComponent.tsx
+++ b/src/client/views/DocComponent.tsx
@@ -192,7 +192,9 @@ export function ViewBoxAnnotatableComponent<P extends FieldViewProps>() {
* This is the unique data repository for a dcoument that stores the intrinsic document data
*/
@computed get dataDoc() {
- return this._renderDoc.isTemplateForField || this._renderDoc.isTemplateDoc ? (this._props.TemplateDataDocument ?? this._renderDoc[DocData]) : this._props.Document[DocData];
+ return this._renderDoc.isTemplateForField || this._renderDoc.isTemplateDoc ?
+ (this._props.TemplateDataDocument ?? this._renderDoc[DocData]) :
+ this._props.Document[DocData]; // prettier-ignore
}
/**
diff --git a/src/client/views/collections/CollectionSubView.tsx b/src/client/views/collections/CollectionSubView.tsx
index a43cf0755..7d487fed8 100644
--- a/src/client/views/collections/CollectionSubView.tsx
+++ b/src/client/views/collections/CollectionSubView.tsx
@@ -109,8 +109,8 @@ export function CollectionSubView<X>() {
get dataDoc() {
return this._props.TemplateDataDocument instanceof Doc && this.layoutDoc.isTemplateForField //
- ? this._props.TemplateDataDocument[DocData]
- : this.layoutDoc.resolvedDataDoc
+ ? Doc.GetProto(this._props.TemplateDataDocument)
+ : this.Document.resolvedDataDoc
? this._props.Document
: this.Document[DocData]; // if the layout document has a resolvedDataDoc, then we don't want to get its parent which would be the unexpanded template
}
diff --git a/src/client/views/nodes/DocumentContentsView.tsx b/src/client/views/nodes/DocumentContentsView.tsx
index 47c5734f7..d1eae1784 100644
--- a/src/client/views/nodes/DocumentContentsView.tsx
+++ b/src/client/views/nodes/DocumentContentsView.tsx
@@ -113,7 +113,7 @@ export class DocumentContentsView extends ObservableReactComponent<DocumentConte
this._props.LayoutTemplate?.() ||
(this._props.LayoutTemplateString && this._props.Document) ||
(this._props.layoutFieldKey && StrCast(this._props.Document[this._props.layoutFieldKey]) && this._props.Document) ||
- Doc.Layout(this._props.Document, this._props.layoutFieldKey ? Cast(this._props.Document[this._props.layoutFieldKey], Doc, null) : undefined);
+ Doc.Layout(this._props.Document, DocCast(this._props.Document[this._props.layoutFieldKey]));
return Doc.expandTemplateLayout(template, this._props.Document);
}
diff --git a/src/client/views/nodes/FieldView.tsx b/src/client/views/nodes/FieldView.tsx
index f82e980f5..933868c46 100644
--- a/src/client/views/nodes/FieldView.tsx
+++ b/src/client/views/nodes/FieldView.tsx
@@ -80,7 +80,7 @@ export interface FieldViewSharedProps {
styleProvider: Opt<StyleProviderFuncType>;
setTitleFocus?: () => void;
focus: FocusFuncType;
- onClickScript?: () => ScriptField;
+ onClickScript?: () => ScriptField | undefined;
onDoubleClickScript?: () => ScriptField;
onPointerDownScript?: () => ScriptField;
onPointerUpScript?: () => ScriptField;