Meteor-Community-Packages / Meteor-Community-Packages/meteor-autoform-select2
Select2 fields within afEachArrayItem are not filled correctly
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 25
- Forks
- 27
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
i am using 'afEachArrayItem' to build a row based form for each array item. that works fine, but i have the following issues:
- to select the first option, i have to do it twice before its accepted
- Within the array, i have another array with string values that are TAGS. I use a helper to generate the options and the options are available in the select, but already selected values are not show even if they are in the options array. This happens not always and NOT TO ALL items of the top array. Please see screenshot below:

the relevant code in the helper is:
tags:function(){
return {width:'100%',multiple:true,tags:true,readonly:true};
},
tagsOptions: function () {
var _editObj = Session.get('editObj');
var _wf = WorkflowDefinitions.findOne({_id:_editObj.id});
var _optionsDraft = [];
var _options = [];
if (_wf)
{
for (var i in _wf.actions){
for (var ii in _wf.actions[i].from){
var _from = _wf.actions[i].from[ii];
if (_optionsDraft.indexOf(_from) < 0){
_optionsDraft.push(_from);
var _option = {};
_option.label = _from;
_option.value = _from;
_options.push(_option)
}
}
}
}
return _options;
},
the field is defined as followed in the template:
{{> afQuickField name= this.current.from select2Options=tags options=tagsOptions label=false}}i use the following versions on meteor 1.2
aldeed:autoform@5.8.0
aldeed:autoform-select2@2.0.2
aldeed:collection2@2.6.0
aldeed:simple-schema@1.5.0
Any help would be very appreciated
Best regards from manila
Ralph
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported afEachArrayItem form with nested tag arrays using the shown tags and tagsOptions helpers and the afQuickField template expression. Inspect the Select2 integration and test whether the first selection is accepted and existing tag values render for every array item; done means both behaviors work consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100