aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/KeyValueBox.tsx
diff options
context:
space:
mode:
authorbrynnchernosky <56202540+brynnchernosky@users.noreply.github.com>2022-10-28 10:10:04 -0400
committerbrynnchernosky <56202540+brynnchernosky@users.noreply.github.com>2022-10-28 10:10:04 -0400
commitceb338752aacc383c97a0e3a9b608365a1cf39b6 (patch)
treed2f355b726a9b21950f332c0f65931d7d6eef515 /src/client/views/nodes/KeyValueBox.tsx
parent5d6a0458b9d4f35e0c568a4d76d4fcab4e22f698 (diff)
parent2fc88a931cb2fc3408297b000208990633445585 (diff)
merge
Diffstat (limited to 'src/client/views/nodes/KeyValueBox.tsx')
-rw-r--r--src/client/views/nodes/KeyValueBox.tsx9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/client/views/nodes/KeyValueBox.tsx b/src/client/views/nodes/KeyValueBox.tsx
index d9f46509e..7d04c4b64 100644
--- a/src/client/views/nodes/KeyValueBox.tsx
+++ b/src/client/views/nodes/KeyValueBox.tsx
@@ -209,13 +209,18 @@ export class KeyValueBox extends React.Component<FieldViewProps> {
}
return parent;
}
- return this.createFieldView(DocCast(this.props.Document.data), rows.lastElement());
+ return rows.length ? this.createFieldView(DocCast(this.props.Document.data), rows.lastElement()) : undefined;
};
createFieldView = (templateDoc: Doc, row: KeyValuePair) => {
const metaKey = row.props.keyName;
- const fieldTemplate = Doc.MakeAlias(templateDoc);
+ const fieldTemplate = Doc.IsDelegateField(templateDoc, metaKey) ? Doc.MakeDelegate(templateDoc) : Doc.MakeAlias(templateDoc);
fieldTemplate.title = metaKey;
+ fieldTemplate.fitWidth = true;
+ fieldTemplate._xMargin = 10;
+ fieldTemplate._yMargin = 10;
+ fieldTemplate._width = 100;
+ fieldTemplate._height = 40;
fieldTemplate.layout = this.inferType(templateDoc[metaKey], metaKey);
return fieldTemplate;
};