Meteor-Community-Packages / Meteor-Community-Packages/meteor-autoform-select2
Value of the selected option is not saved in the collection.
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 25
- Forks
- 27
- PR merge metrics
- No merged PRs in 30d
Description
I created a field of a schema (CollectionTest) as follows.
```
year: {
type: String,
label: "Year",
autoform:{
type:'select2',
options:function () {
return[{label:"2013",value:3102},{label:"2014",value:4102},{label:"2015",value:5102}]
}
}
}
```
When I submit the autoform, it is inserted to the collection. But regardless of the selected option of the year, the year field is always saved as "2013" (which is not even a value).
```
collectionTest
{
"_id" : "iysowN69pKWJeajDa",
"year" : "2013"
}
```
But when I change the 'select2' to 'select' it works fine. But I need to implement the 'select2' because the year field should be searchable.
And I imported following packages before implementing select2 field.
```
aldeed:autoform-select2
natestrauser:select2
```
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 schema with the `select2` and `select` input types using the `aldeed:autoform-select2` and `natestrauser:select2` packages. Trace how the selected option is passed from the searchable input into AutoForm submission. Done means the selected option's value, rather than its label, is saved in the collection.
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
- 45/100