-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Describe the bug
If I add the below JavaScript in the Custom Default Value, the Select component value appears multiple times.
console.log(">>> selectJson custom_default_value");
return [{label:"cedric",value:"01"},
{label:"Irene",value:"02"} ,
{label:"Gisa",value:"03"}
];
Version/Branch
sandbox default version /4.14.6
To Reproduce
Steps to reproduce the behavior:
-
Create form.
-
Add Select component.
-
Edit the form and navigate to the Data tab
-
Select the Multiple values
-
Edit the custom Default value
-
Add this in Javascript
console.log(">>> selectJson custom_default_value");return [{label:"cedric",value:"01"}, {label:"Irene",value:"02"} , {label:"Gisa",value:"03"} ];
Expected behavior
Only unique values should be displayed — currently, I can see duplicate entries.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Hosting Type :
https://formio.github.io/formio.js/app/sandbox.html
formio js version : default version /4.14.6
Form JSON :
{
"display": "form",
"components": [
{
"label": "Select",
"widget": "choicesjs",
"tableView": true,
"multiple": true,
"customDefaultValue": "console.log(">>> selectJson custom_default_value");\n \n return [{label:"cedric",value:"01"},\n \n {label:"Irene",value:"02"} ,\n \n {label:"Gisa",value:"03"}\n \n ];",
"validateWhenHidden": false,
"key": "select",
"type": "select",
"input": true
},
{
"type": "button",
"label": "Submit",
"key": "submit",
"disableOnInvalid": true,
"input": true,
"tableView": false
}
]
}
