From 0c705fe225490a4552ba5ac7b116d645d6910916 Mon Sep 17 00:00:00 2001 From: 18alantom <2.alan.tom@gmail.com> Date: Thu, 9 Jun 2022 14:12:41 +0530 Subject: [PATCH] fix: error height in two column form - indicate dev mode --- src/components/Sidebar.vue | 6 ++++++ src/components/TwoColumnForm.vue | 16 ++++++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/components/Sidebar.vue b/src/components/Sidebar.vue index 3fef2e28..a49431af 100644 --- a/src/components/Sidebar.vue +++ b/src/components/Sidebar.vue @@ -108,6 +108,12 @@

{{ t`Change DB` }}

+

+ dev mode +

diff --git a/src/components/TwoColumnForm.vue b/src/components/TwoColumnForm.vue index 29d3f3ed..f3e59a29 100644 --- a/src/components/TwoColumnForm.vue +++ b/src/components/TwoColumnForm.vue @@ -59,9 +59,7 @@ :style="{ ...style, - height: !['AttachImage', 'Text'].includes(df.fieldtype) - ? 'calc(var(--h-row-mid) + 1px)' - : 'calc((var(--h-row-mid) + 1px) * 2)', + height: getFieldHeight(df), }" >
@@ -157,6 +155,17 @@ export default { } }, methods: { + getFieldHeight(df) { + if (['AttachImage', 'Text'].includes(df.fieldtype)) { + return 'calc((var(--h-row-mid) + 1px) * 2)'; + } + + if (this.errors[df.fieldname]) { + return 'calc((var(--h-row-mid) + 1px) * 2)'; + } + + return 'calc(var(--h-row-mid) + 1px)'; + }, getRegularValue(df) { if (!df.inline) { return this.doc[df.fieldname]; @@ -307,7 +316,6 @@ export default { .join(' '); return { 'grid-template-columns': templateColumns, - height: 'calc(var(--h-row-mid) + 1px)', }; }, submitted() {