Question T9836
Visible to All Users

VisibleIf not working correctly for Ranking question

created 3 years ago

Hello,

I have a survey where I'm setting visibleIf logic in a question.
When i use ranking question in the condition then it is not working correctly other than 1st time.

Example I have question1(ranking) question2 (single line text)
Question2 have logic as -->

Code
"visibleIf": "{question1} = ['item2', 'item1', 'item3']"

And if we select question answer as per logic, question2 is visible which is OK. When we again rearrange question1 as ['item3', 'item1', 'item2'], in this case question2 must be hidden but this is not happening right now.

Here is the example.
https://codesandbox.io/s/surveyjs-angular-forked-3e5lx9

Answers approved by surveyjs Support

created 3 years ago

Hello,
I can see the issue. We do not require the correct order for comparing arrays. However, it doesn't work correctly for ranking question.
We will discuss it internally and comeback.

Thank you,
Andrew
SurveyJS Team

    Comments (1)

      There is no an easy solution for this issue.
      Expression module doesn't know about question types and right now, I do not see how to tell this module that for checkbox question type you should ignore the array order and for ranking type the order is important.
      Do you have a real business case? Could you explain it in details?

      Thank you,
      Andrew
      SurveyJS Team