#176 - Fix for tax fields

This commit is contained in:
Elio Struyf
2022-02-17 19:21:29 -08:00
parent b17c7f888a
commit e577ba591e

View File

@@ -70,6 +70,11 @@ export const WrapperField: React.FunctionComponent<IWrapperFieldProps> = ({
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<IWrapperFieldProps> = ({
}
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