Longform fields support for JSON string (#9666)

This commit is contained in:
melohagan 2023-02-13 11:06:33 +00:00 committed by GitHub
parent 27b7e8f02c
commit ee054adf39
2 changed files with 3 additions and 3 deletions

View File

@ -25,8 +25,8 @@
const getOptions = (schema, type) => { const getOptions = (schema, type) => {
let entries = Object.entries(schema ?? {}) let entries = Object.entries(schema ?? {})
let types = [] let types = []
if (type === "field/options") { if (type === "field/options" || type === "field/longform") {
// allow options to be used on both options and string fields // allow options and longform to be used on string fields as well
types = [type, "field/string"] types = [type, "field/string"]
} else { } else {
types = [type] types = [type]

View File

@ -85,7 +85,7 @@
</Skeleton> </Skeleton>
{:else if !fieldState} {:else if !fieldState}
<Placeholder /> <Placeholder />
{:else if schemaType && schemaType !== type && type !== "options"} {:else if schemaType && schemaType !== type && !["options", "longform"].includes(type)}
<Placeholder <Placeholder
text="This Field setting is the wrong data type for this component" text="This Field setting is the wrong data type for this component"
/> />