question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

survey-vue: survey navigation becomes unresponsive if all survey fields are read-only

See original GitHub issue

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

Reporting a bug

What is the current behavior?

When a multi-page survey displays only pre-filled, read-only fields, navigation breaks and it is not possible to navigate away from the current survey page. The previous/next navigation buttons are not clickable.

What is the expected behavior?

Regardless of how the fields are filled (user input or pre-populated), it should be possible to complete the survey successfully. Buttons should not become disabled.

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

  • Create a component like this one that will read a JSON configuration file, render the survey and pre-populate the fields and make them readOnly if a value is provided.
  • Navigate the survey: after hitting the second page, it will be impossible to move forward or backward in the survey.

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

Vue Component Code: see here

Survey Configuration:

{
  "pages": [
    {
      "title": "Page1 - page {pageno} of {pagecount}.",
      "questions": [
        {
          "name": "regNumber",
          "type": "text",
          "title": "Registration Number:",
          "placeHolder": "",
          "isRequired": true,
          "readOnly": true,
          "requiredErrorText": "Required Field"
        },
        {
          "name": "Type",
          "type": "text",
          "title": "Type:",
          "placeHolder": "",
          "defaultValue": "Default Type",
          "isRequired": true,
          "readOnly": true,
          "requiredErrorText": "Required Field"
        },
        {
          "name": "regName",
          "type": "text",
          "title": "Registration Name:",
          "placeHolder": "",
          "isRequired": true,
          "readOnly": true,
          "requiredErrorText": "Required Field"
        }
      ]
    },
    {
      "title": "Page2 - page {pageno} of {pagecount}.",
      "questions": [
        {
          "name": "streetAddress",
          "type": "text",
          "title": "Street Address:",
          "placeHolder": "",
          "isRequired": true,
          "readOnly" : true,
          "requiredErrorText": "Required Field"
        },
        {
          "name": "city",
          "type": "text",
          "title": "City:",
          "placeHolder": "",
          "isRequired": true,
          "readOnly" : true,
          "requiredErrorText": "Required Field"
        },
        {
          "name": "province",
          "type": "text",
          "title": "Province:",
          "placeHolder": "",
          "isRequired": true,
          "readOnly" : true,
          "requiredErrorText": "Required Field"
        },
        {
          "name": "country",
          "type": "text",
          "title": "Country:",
          "placeHolder": "",
          "isRequired": true,
          "readOnly" : true,
          "requiredErrorText": "Required Field"
        },
        {
          "name": "postalCode",
          "type": "text",
          "title": "Postal Code:",
          "placeHolder": "",
          "isRequired": true,
          "readOnly" : true,
          "requiredErrorText": "Required Field"
        }
      ]
    },
    {
      "title": "Page3 - page {pageno} of {pagecount}.",
      "questions": [
        {
          "name": "instructions",
          "type": "text",
          "title": "Instructions:",
          "placeHolder": "",
          "defaultValue": "N.A.",
          "isRequired": true,
          "readOnly" : true,
          "requiredErrorText": "Required Field"
        },
        {
          "name": "otherInstructions",
          "type": "text",
          "title": "Other Instructions:",
          "placeHolder": "",
          "defaultValue": "N.A.",
          "isRequired": true,
          "readOnly" : true,
          "requiredErrorText": "Required Field"
        }
      ]
    },
    {
      "title": "Page4",
      "questions": [
        {
          "name": "nok_FullName",
          "type": "text",
          "title": "Next of Kin -  Full Name:",
          "placeHolder": "",
          "isRequired": true,
          "readOnly" : true,
          "requiredErrorText": "Required Field"
        },
        {
          "name": "nok_StreetAddress",
          "type": "text",
          "title": "Next of Kin - Street Address:",
          "placeHolder": "",
          "isRequired": true,
          "readOnly" : true,
          "requiredErrorText": "Required Field"
        },
        {
          "name": "nok_City",
          "type": "text",
          "title": "Next of Kin - City:",
          "placeHolder": "",
          "isRequired": true,
          "readOnly" : true,
          "requiredErrorText": "Required Field"
        },
        {
          "name": "nok_Province",
          "type": "text",
          "title": "Next of Kin - Province:",
          "placeHolder": "",
          "isRequired": true,
          "readOnly" : true,
          "requiredErrorText": "Required Field"
        },
        {
          "name": "nok_Country",
          "type": "text",
          "title": "Next of Kin - Country:",
          "placeHolder": "",
          "isRequired": true,
          "readOnly" : true,
          "requiredErrorText": "Required Field"
        },
        {
          "name": "nok_PostalCode",
          "type": "text",
          "title": "Next of Kin - Postal Code:",
          "placeHolder": "",
          "isRequired": true,
          "readOnly" : true,
          "requiredErrorText": "Required Field"
        }
      ]
    },
    {
      "title": "Page5 - page {pageno} of {pagecount}.",
      "questions": [
        {
          "name": "registrationDate",
          "type": "text",
          "title": "Registration Date:",
          "placeHolder": "",
          "isRequired": true,
          "readOnly" : true,
          "requiredErrorText": "Required Field"
        },
        {
          "name": "registrationExpiryDate",
          "type": "text",
          "title": "Registration Expiry Date:",
          "placeHolder": "",
          "isRequired": true,
          "readOnly" : true,
          "defaultValue": "N.A.",
          "requiredErrorText": "Required Field"
        },
        {
          "name": "issueDate",
          "type": "text",
          "title": "Issue Date:",
          "placeHolder": "",
          "isRequired": true,
          "readOnly" : true,
          "defaultValue": "N.A.",
          "requiredErrorText": "Required Field"
        },
        {
          "name": "expirationDate",
          "type": "text",
          "title": "Expiration Date:",
          "placeHolder": "",
          "isRequired": true,
          "readOnly" : true,
          "defaultValue": "N.A.",
          "requiredErrorText": "Required Field"
        },
        {
          "name": "status",
          "type": "text",
          "title": "Status:",
          "placeHolder": "",
          "defaultValue": "Ready",
          "isRequired": true,
          "readOnly" : true,
          "requiredErrorText": "Required Field"
        }
      ]
    }
  ]
}

Setting up the example completely is not 100% straightforward as this is used as part of a bigger set of applications that are inter-dependant. I tried reproducing the issue with a vanilla JS implementation and minimal survey on plunkr see here, however I am unable to trigger the issue there. The problem is, however, consistent in my Vue survey.

The Vue component linked above has all of the code responsible for rendering the survey, I’ll be happy to help setting up a more complex example if the component code + the configuration is not enough to reproduce and/or understand what the issue is.

Specify your

  • browser: Firefox Developer Edition
  • browser version: 87.0b9
  • browser: Chrome
  • browser version: 89.0.4389.90
  • surveyjs platform (angular or react or jquery or knockout or vue): vue
  • surveyjs version: survey-vue: ^1.8.26

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
esunecommented, Mar 22, 2021

@andrewtelnov I’ll work on a setup either on Code SandBox or in a fork of my repo with all the code you need, I’ll post it here once ready.

0reactions
andrewtelnovcommented, Mar 23, 2021

@esune Great! I beleive the version we are going to release shortly v1.8.37 should not have a problem with duplicated symbols. I believe we fixed it in the current version v1.8.36, but I did not check it. Anyway, I believe we can close this issue.

Thank you, Andrew

Read more comments on GitHub >

github_iconTop Results From Across the Web

Read Only Feature not working · Issue #608 · surveyjs/survey ...
I have used Dropdown Element. I set dropdown field as readonly and saved it. When I come back after save as readonly, Option...
Read more >
Solved: Read only fields not displaying in Survey when edi...
Solved: I have created a survey that is preloaded with data from our enterprising data base. The survey is setup to use the...
Read more >
REDCap Frequently Asked Questions - Wiki@UCSF
When a survey is "offline" participants will no longer be able to view your survey. They will navigate to a page that displays...
Read more >
Using Action Tags in REDCap
Each action tag has a corresponding action that is performed for the field when displayed on data entry forms and survey pages. To...
Read more >
Whats New - SurveyJS
It may be required to turn the Survey Creator into a read-only state while allowing some specific operations. Hence, the creator's readOnly option...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found