An add-on Meteor package for aldeed:autoform. Provides a custom input type for Materialize chips (tags) (http://materializecss.com/chips.html.
In a Meteor app directory, enter:
$ meteor add aldeed:autoform
There are several materialize packages available. I used the official materialize:materialize:
meteor add materialize:materialize
In a Meteor app directory, enter:
$ meteor add dguedry:autoform-materialize-chips
All avaiable parameters for Materialize chips can be defined in a SimpleSchema object. Here's an example:
Schema.Notes = new SimpleSchema({
...
tags: {
type: [String],
autoform: {
type: "materialize-chips",
afFieldInput: {
placeholder: '+Tag',
secondaryPlaceholder: 'Add tag(s)',
autocompleteOptions: {
limit: Infinity,
minLength: 0,
data: function() {return {'Apple': null,'Microsoft': null,'Google': null}}
}
}
}
},
...
That's it. Any field defined as type "materialize-chips" will have full chips functionality within a quickForm
or an afQuickField
:
Anyone is welcome to contribute. Fork, make your changes, and then submit a pull request.