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) => {
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]

View File

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