From e577ba591e1d5b4564f76ca8bfb2d8092022fef1 Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Thu, 17 Feb 2022 19:21:29 -0800 Subject: [PATCH] #176 - Fix for tax fields --- src/panelWebView/components/Fields/WrapperField.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/panelWebView/components/Fields/WrapperField.tsx b/src/panelWebView/components/Fields/WrapperField.tsx index c67e4eac..48469984 100644 --- a/src/panelWebView/components/Fields/WrapperField.tsx +++ b/src/panelWebView/components/Fields/WrapperField.tsx @@ -70,6 +70,11 @@ export const WrapperField: React.FunctionComponent = ({ useEffect(() => { let value: any = parent[field.name]; + + if (field.type === "tags" || field.type === "categories" || field.type === "taxonomy") { + setFieldValue(value); + return; + }; if (field.type === 'datetime') { value = getDate(value) || undefined; @@ -83,10 +88,6 @@ export const WrapperField: React.FunctionComponent = ({ } onSendUpdate(field.name, value, parentFields); - } else { - if (field.type === "tags" || field.type === "categories" || field.type === "taxonomy") { - value = []; - } } // Check if the field value contains a placeholder