surveyjs / survey-library

Free JavaScript form builder library with integration for React, Angular, Vue, jQuery, and Knockout.
https://surveyjs.io/form-library
MIT License
4.1k stars 798 forks source link

none now appears before other #4820

Closed matthewberryman closed 2 years ago

matthewberryman commented 2 years ago

Are you requesting a feature, reporting a bug or asking a question?

Bug

What is the current behavior?

None now appears before other: 188373392-716caf27-b26b-4fcc-8510-6f46ae78308c

What is the expected behavior?

None appears as the last option

How would you reproduce the current behavior (if this is a bug)?

Have a question with

      "hasNone": true,
      "hasOther": true,

Provide the test code and the tested page URL (if applicable)

https://plnkr.co/edit/sRtm2OHz4hM1twH9

Specify your

Bug seems to have been introduced after v1.9.29

JaneSjs commented 2 years ago

Hello, The Other option is actually displayed at the end of the list because this option follows the text input area.

If you wish to display the None option at the last position, you can disable the hasOther option and create a custom Other Text/Comment question and toggle its visibility withthe visibleIf option.

"elements": [
    {
      "type": "checkbox",
      "name": "car",
      "title": "What car are you driving?",
      "isRequired": true,
      "hasNone": true,
      "hasOther": false,
      "colCount": 4,
      "choices": [
        "Ford",
        "Vauxhall",
        "Volkswagen",
        "Nissan",
        "Audi",
        "Mercedes-Benz",
        "BMW",
        "Peugeot",
        "Toyota",
        "Citroen",
        "Other"
      ]
    },
    {
      "type": "text",
      "name": "otherinfo",
      "title": "Other (describe)",      
      "visibleIf": "{car} contains 'Other'"  
    }
  ],
  "showQuestionNumbers": false

Example.