survey-creator
survey-creator copied to clipboard
Choices - Introduce an API which would allow defining the value for choices added via a Fast Entry editor
T18227 - Automatic choice injection https://surveyjs.answerdesk.io/internal/ticket/details/T18227
When you use the fast entry editor, you expect to specify the value and text separated by |.
1 | Option-1
2 | Option-2
3 | Option-3
4 | Option-4
5 | Option-5
Choices with a corresponding value and text will be created.
However, if you do not explicitly specify the value attribute, as follows:
Option-1
Option-2
Option-3
Option-4
Option-5
Those strings will be used as values:
In a usage scenario, it's required to use supplied strings as texts and auto-generate ordered numbers for these choices to achieve the following output:
Consider introducing an API which would allow developers to manage auto-generated choices and override their values and texts. For the record: creator.onItemValueAdded is raised only when adding a new choice via the Add New button.