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.11k stars 801 forks source link

Multiple Text Items Not including Input Type in JSON when default Text Option is selected #5984

Closed kkillionMM closed 3 months ago

kkillionMM commented 1 year ago

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

Bug

What is the current behavior?

Using the SurveyJS Designer tool on your website, I added a Multiple Text question type to my survey, then added my items. My Items default to the Input Type of 'text', which is fine, but that does not show in the JSON Editor view. Because of this, when I copy/paste the JSON and put into our Angular integration, it errors out when trying to render the full survey. It's missing the JSON element tag for Input Type. If we manually add this element the survey renders properly. Some of the other input types do show like Date, Time.

image

image

What is the expected behavior?

Expected behavior would be to include the input type within the JSON for all options.

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

Create a multiple text question and add an item and see if the input type element shows in the JSON.

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

Tested page URL:

https://surveyjs.io/service/editsurvey/676242d0-a350-4ab2-9af3-e78f5f9e1683

Test code

Using your site.

Specify your

JaneSjs commented 1 year ago

Hello @kkillionMM, The default value of an inputType property value is text. Survey Creator doesn't save default values of survey elements. Otherwise, the resulting survey JSON would have a huge size.

However, I cannot entirely understand what issue you faced due to the fact that single-text inputs do not have their inputType property set to text. Would you please elaborate on it? Please feel free to share an Angular demo for research.