comerc / meteor-autoform-typeahead

Custom "typeahead" input type for AutoForm
MIT License
13 stars 11 forks source link

Name is ignored in schema options #6

Open Framnk opened 9 years ago

Framnk commented 9 years ago

I have a field I want to use as a typeahead in my form schemas which is defined as follows:

selected: { type: String, label: 'User', optional: false, autoform: { type: "typeahead", options: function () { return Users.find({name: {$ne:null}}).map(function (d) { return {label: d.name, value: d._id}; }); }, }

However when the typeahead is rendered it uses only the value from the returned select options. Is there a way to allow the displayed value to be the label and what is actually submitted be the value? (Similar to a select).

Note: this options syntax is currently what is shown on the auto form 'demo' site for using this plugin

nzwade commented 8 years ago

@Framnk did you have any luck resolving this?

slaivyn commented 8 years ago

It seams to be fixed by the following commit https://github.com/comerc/meteor-autoform-typeahead/commit/b7dc031c5cf4621e8fea4a1d5f490eaeab819c60 @comerc : hi, would you have some time to build a new package and push it to atmosphere? It would save us from doing a git clone and all this stuff... Thanks a lot!!