Closed theAtaya closed 3 years ago
@theAtaya I did not test it with react, but I am pretty sure that I have fixed the issue by the commit above. The similar issue was in knockout. I add a condition that will not allow to add a new option if "other" option is choosen.
Thank you, Andrew
Hey, @andrewtelnov I just tried it out and it's fixed now! Thanks!
Are you requesting a feature, reporting a bug or asking a question?
Bug
What is the current behavior?
In React version (maybe in others too but I use/noticed this in React) when the select2 widget is active, and the
storeOthersAsComment
is set tofalse
and the dropdown question has the other option (hasOther: true
), select the "Other" option and try to write something in the textarea. As soon as you type one key, it will add that as a new option in the dropdown (and it will be selected) and the textarea gets hidden.What is the expected behavior?
When you select the "other" option you can type in the textarea as much as you want without hiding the field and adding it to the dropdown as a new option (so just like it behaves without storeOthersAsComment set to false).
How would you reproduce the current behavior (if this is a bug)?
Activate select2, add a dropdown question, then set the
hasOther
totrue
and also set thestoreOthersAsComment
tofalse
.Provide the test code and the tested page URL (if applicable)
From this page: https://surveyjs.io/Examples/Library?id=custom-widget-select2&platform=Reactjs&theme=bootstrap (Edit in...) I created a new codesandbox fork and edited to reproduce the bug. It's nothing to do with
choicesByUrl
since it's reproducible with normal choices too.Tested page URL: https://codesandbox.io/s/xenodochial-fire-1lkbl
Test code
Specify your