Meteor-Community-Packages / Meteor-Community-Packages/meteor-autoform-select2
Autoform afQuickField not working well with type="select2" and multiple=true.
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 `afQuickField` with `type="select2"` and `multiple=true`.
#### html:-
`{{> afQuickField name="Country" type="select2" multiple=true select2Options=s2Opts options=optionsCountry }}`
#### js:-
```
s2Opts(){
return {
placeholder: "select upto 8 county",
tags: true
};
},
optionsCountry(){
return [{
label:"India"
value:"india"
},{
label:"North America"
value:"north-america"
},{
label:"South Africa"
value:"south-africa"
},{
label:"China"
value:"china"
},{
label:"Nepal"
value:"nepal"
},{
label:"Shri Lanka"
value:"shri-lanka"
},{
label:"Malesiya"
value:"malesiya"
},{
label:"Afghanistan"
value:"afghanistan"
},{
label:"Canada"
value:"canada"
},{
label:"France"
value:"france"
}];
}
```
#### Schema :-
```
Country: {
type: [String],
optional: true,
maxCount: 8,
autoform: {
label: "Country"
}
},
```
When we select 3 or more countries and click on update button.
### Current Result:-
- It shows only one selected Country which is top in the list among selected Countries.

### Expected Result:-
- It should show all 3 selected Countries after click on update button.
Please advise.
Thanks and Regards,
Saransh
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 afQuickField setup with type="select2", multiple=true, select2Options, and the array schema shown in the issue. Trace how the selected values are restored after clicking Update. Done means all selected countries, not only the first, remain selected after the form is updated.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100