Comments (7)
I had the same issue here - I changed the code to loop through the entries using a for loop and added them that way, seemed to fix it!
_initialTags: function() {
var input = this;
if (this.options.initialTags.length != 0) {
for (var i = 0; i < this.options.initialTags.length; i++) {
input._addTag(this.options.initialTags[i]);
}
}
}
from jquery-tagit.
same using jquery each method:
_initialTags: function() {
var input = this;
if (this.options.initialTags.length != 0) {
$(this.options.initialTags).each(function(i, element){
input._addTag(element);
});
}
}
from jquery-tagit.
Iterating over initialTags doesn't work because the array object doesn't have an each call defined. The following solves the issue, though think _initialTags should use the regular way of iterating the array like @dk1 did.
Array.prototype.each = function(callback){
for (var i = 0; i < this.length; i++){
callback(this[i]);
}
};
from jquery-tagit.
@dk1, Thanks I was having the same problem. You should make a pull request.
from jquery-tagit.
Looks like @aarek has already made a fork with a fix. @aarek - have you made a pull request?
from jquery-tagit.
yup
from jquery-tagit.
Thank you aarek, pull request merged :)
from jquery-tagit.
Related Issues (20)
- dependency listed incorrectly. requires jquery 1.9+.
- Can't delete Items HOT 1
- event.originalEvent.originalEvent is undefined
- Link broken in repo description
- IPhone needs to be clicked two times to take effect
- triggerKeys option does not work properly HOT 1
- Console log in code
- Runtime error in tag-it... has no method 'widget' HOT 4
- set value to blank in case when allowNewTags is set to true
- initialTags not working when using options
- Select not included in form when clearing tags
- Active development HOT 3
- "maxTags" invalid when leave focus to add a tag. HOT 1
- input lose inline styles on long tags HOT 1
- duplicate tag HOT 1
- minLenght on blur
- Tag not completed when triggerkey is pressed very quickly after last inputted character
- I creat a list by getJSON, but tagit doesn't work on it
- Accessing autocomplete object HOT 1
- Jqueryui Autocomplete Select option does not work on pressing ENTER key HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jquery-tagit.