survey-creator icon indicating copy to clipboard operation
survey-creator copied to clipboard

Invalid conditions syntax (Expression Editor)

Open dasboe opened this issue 1 year ago • 1 comments

In SurveyJs it is possible to show/hide a question based on a condition but the condition can be of invalid Syntax:

Bildschirmfoto 2024-02-29 um 12 39 08

What is the current behavior?

If the condition has an invalid syntax SuveyJs will save the condition but will not execute it. There is no visual feedback to the user that the condition is invalid.

What is the expected behavior?

Provide visual user feedback that the condition is invalid syntax and do not allow saving conditions with invalid syntax

Test code with an invalid condition:

{
 "title": "Test Title",
 "pages": [
  {
   "name": "page1",
   "elements": [
    {
     "type": "boolean",
     "name": "question1"
    },
    {
     "type": "text",
     "name": "question2",
     "visibleIf": "{question1 = true"
    }
   ]
  }
 ]
}

dasboe avatar Feb 29 '24 12:02 dasboe

We have expression editor in our Roadmap. This task should be solved in this context.

Thank you, Andrew

andrewtelnov avatar Apr 19 '24 09:04 andrewtelnov