From ee054adf394be5f89c05cfa7f3e3f0da1c4b871f Mon Sep 17 00:00:00 2001 From: melohagan <101575380+melohagan@users.noreply.github.com> Date: Mon, 13 Feb 2023 11:06:33 +0000 Subject: [PATCH] Longform fields support for JSON string (#9666) --- .../design/settings/controls/FormFieldSelect.svelte | 4 ++-- packages/client/src/components/app/forms/Field.svelte | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/builder/src/components/design/settings/controls/FormFieldSelect.svelte b/packages/builder/src/components/design/settings/controls/FormFieldSelect.svelte index 806abc4e92..b7b9f87bb4 100644 --- a/packages/builder/src/components/design/settings/controls/FormFieldSelect.svelte +++ b/packages/builder/src/components/design/settings/controls/FormFieldSelect.svelte @@ -25,8 +25,8 @@ const getOptions = (schema, type) => { let entries = Object.entries(schema ?? {}) let types = [] - if (type === "field/options") { - // allow options to be used on both options and string fields + if (type === "field/options" || type === "field/longform") { + // allow options and longform to be used on string fields as well types = [type, "field/string"] } else { types = [type] diff --git a/packages/client/src/components/app/forms/Field.svelte b/packages/client/src/components/app/forms/Field.svelte index a14c6ac9c8..435805cee8 100644 --- a/packages/client/src/components/app/forms/Field.svelte +++ b/packages/client/src/components/app/forms/Field.svelte @@ -85,7 +85,7 @@ {:else if !fieldState} - {:else if schemaType && schemaType !== type && type !== "options"} + {:else if schemaType && schemaType !== type && !["options", "longform"].includes(type)}