Skip to content

Survey Creator: JSON Editor incorrectly flags a valid property value as invalid #10813

@JaneSjs

Description

@JaneSjs

T26135 - Custom Descriptive Demo causes error in the textSize property
https://surveyjs.answerdesk.io/internal/ticket/details/T26135


In this demo, a custom "textSize" property is declared as follows:
View in CodeSandbox

{
   name: "textSize",
   category: "general",
   visibleIndex: 3,
   default: "medium",
   choices: [
      { value: "small", text: "Small" },
      { value: "medium", text: "Medium" },
      { value: "large", text: "Large" }
   ]
}

In a survey JSON, this property is stored as follows:

However, a JSON Editor displays the following error:

"Line: 7. The property value: 'large' is incorrect for property 'textSize'."

If you fix this error, a property is updated as follows:

"textSize": "{\"value\":\"small\",\"text\":\"Small\"}"

However, this value is also considered invalid:

Line: 7. The property value: '{"value":"small","text":"Small"}' is incorrect for property 'textSize'.

Metadata

Metadata

Assignees

Labels

buguser issueAn issue or bug reported by users

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions