Item template changes for select component whenever the control is open in edit mode in builder [BUG]
Environment
Please provide as many details as you can:
- Hosting type
- [ ] Local deployment
- Version: 4.2.6
- [ ] Local deployment
- Formio.js version: 4.2.6
- Frontend framework: angular-formio
- Browser: Google Chrome
- Browser version: 77.0.3865.90 (Official Build) (64-bit)
Steps to Reproduce
- Take a select component on form.
- Set URL and set the field name in value property "param_id" and set item template value as "{{ item.param_name }}".
- click on save button.
- Change any value of select component from UI.
Expected behavior: Setting should be remain as it was done at the time of design.
Observed behavior: Property value field "param_id" is being set in item template as "{{ item.param_id }}" on the place of {{ item.param_name }}.
Example
NA

This is a known item that we are trying to resolve. We have had a lot of people report it but haven't been able to reproduce it yet for some reason. Can you provide a form or more information on how to reproduce it?
This is happening due to the below code in select.edit.data.js
onChange: function onChange(context) { var valueProp = context.instance.data.valueProperty; var templateProp = valueProp ? valueProp : 'data'; var template = "{{ item.".concat(templateProp, " }}"); var searchField = valueProp ? "".concat(valueProp, "__regex") : ''; context.instance.root.getComponent('template').setValue(template); context.instance.root.getComponent('searchField').setValue(searchField); }
template value is set to valueProp if it is present
@sanjaykrgaur This should be resolved in v 4.4.2