cheonhyangzhang / paper-tags-input Goto Github PK
View Code? Open in Web Editor NEWPolymer element for tags input.
License: MIT License
Polymer element for tags input.
License: MIT License
Hello I'm getting the below error while deleting the tags using the x button..any help?
tag-item.html:159 Uncaught TypeError: Cannot read property 'parentElement' of null
Here is actual line of code.
var parent = e.target.parentElement.parentElement.parentElement;
This might cause problem of multiple paper-tags-input in the same page.
Per @apalaniuk
it's well worth noting here that your default value initialization of the tags property doesn't seem right. You're setting the value to be an empty array, which will cause a single array to be used across all instances of the component, so you can't use multiple components on the same page with independent tags. The default value for arrays and objects (if set) should be a function that returns a new array instead, which is invoked once per instance - or you can do as you're doing in _addTag and lazily initialize if needed. See https://www.polymer-project.org/1.0/docs/devguide/properties#configure-values
Also, if (typeof(this.tags) == 'undefined' || this.tags == null) is redundant - this.tags == null will catch both null and undefined. But, shouldn't it be this.tags instanceof Array?
Thank you for the good work.
A suggestion feature would be so great.
<paper-tag-input
tag-suggestions="idOfIronAjaxElemThatKnowsWhereToLook"
>
</paper-tags-input>
In the demo if you enter a new tag it is added to all elements of paper-tags-input.
Array not initialized error, recommend changing _addTag function as follows:
_addTag: function(tag){
if (this.enableAdd == false){
return;
}
if (typeof(this.tags) == 'undefined' || this.tags == null){
this.tags = [];
}
this.tags.push(tag);
this.tags = this.tags.slice();
},
Added this.tags == null
to catch the issue
Can you put a license on this? MIT would be nice.
The installation instructions have the following command:
bower install paper-tags-input
However, this only adds the needed files and does not add the element to the bower.json. The command should be updated as follows:
bower install --save paper-tags-input
This will add the element to the bower.json so it can be installed with bower install
. This will also make it more consistent with other Polymer element documentation (see <paper-button>
for example).
Need to have a function to add the tag and inside of it need to check if input is empty or duplicate.
I receive following error:
Uncaught TypeError: Cannot set property 'invalid' of null, paper-tags-input.html:262
It should not use following syntax:
var input = document.querySelector('#tag-input');
since it use shadow DOM.
If you replace it with:
var input = Polymer.dom(this.root).querySelector('#tag-input');
it will be working.
Which means you can't set them to false with markup. If you want to set them to false currently, you have to create Boolean properties and use those.
see:
https://www.polymer-project.org/1.0/docs/devguide/properties#configuring-boolean-properties
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.