aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/KeyValueBox.tsx
diff options
context:
space:
mode:
authorgeireann <geireann.lindfield@gmail.com>2022-10-31 14:33:42 -0400
committergeireann <geireann.lindfield@gmail.com>2022-10-31 14:33:42 -0400
commit85f9dd5b114ed44a13c11eeded12666f0d7e7be2 (patch)
treeb6bbdd3319312eb26dce931c7b5ab0c6514e84d3 /src/client/views/nodes/KeyValueBox.tsx
parentaaf2c5fb4c0b6c6063f824eda3ff29c3bf18d2c4 (diff)
parent70c998562c8560283a7d6b9a1ae78b9207e3720f (diff)
Merge branch 'master' of https://github.com/brown-dash/Dash-Web
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;
};