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.12k stars 802 forks source link

A survey is switched to the next page once a user starts entering text into the Other field #7681

Closed johnnythinks closed 8 months ago

johnnythinks commented 8 months ago

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

Reporting a bug

What is the current behavior?

There is an issue with "showOtherItem" for a dropdown question and "goNextPageAutomatic" as true. When you select "other" and start typing, it will auto navigate to the next question after entering a single character.

What is the expected behavior?

When "other" is picked, turn off goNextPageAutomatic for that question.

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

You can use this sample survey json

{
 "logoPosition": "right",
 "pages": [
  {
   "name": "page1",
   "elements": [
    {
     "type": "dropdown",
     "name": "question1",
     "choices": [
      "Item 1",
      "Item 2",
      "Item 3"
     ],
     "showOtherItem": true
    }
   ]
  },
  {
   "name": "page2",
   "elements": [
    {
     "type": "dropdown",
     "name": "question2",
     "choices": [
      "Item 1",
      "Item 2",
      "Item 3"
     ]
    }
   ]
  },
  {
   "name": "page3",
   "elements": [
    {
     "type": "text",
     "name": "question3"
    }
   ]
  }
 ],
 "showTitle": false,
 "showPageTitles": false,
 "showCompletedPage": false,
 "showQuestionNumbers": "off",
 "progressBarType": "questions",
 "goNextPageAutomatic": true,
 "autoGrowComment": true,
 "questionsOnPageMode": "questionPerPage"
}

The

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

Specify your

johnnythinks commented 8 months ago

I just tried out your fix and it looks fixed! Thank you