Skip to content

Commit

Permalink
[BUGFIX] #724 - when using "tagTextProp" setting, and typing a tag, w…
Browse files Browse the repository at this point in the history
…ithout a whitelist, "value" property is set to "undefined"
  • Loading branch information
yairEO committed Jan 12, 2021
1 parent 4d9912f commit b503bed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/tagify.js
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@ Tagify.prototype = {
whitelistWithProps = whitelist ? whitelist[0] instanceof Object : false,
// checks if this is a "collection", meanning an Array of Objects
isArray = tagsItems instanceof Array,
mapStringToCollection = s => (s+"").split(delimiters).filter(n => n).map(v => ({ [tagTextProp]:this.trim(v) }))
mapStringToCollection = s => (s+"").split(delimiters).filter(n => n).map(v => ({ [tagTextProp]:this.trim(v), value:this.trim(v) }))

if( typeof tagsItems == 'number' )
tagsItems = tagsItems.toString()
Expand Down Expand Up @@ -1104,7 +1104,7 @@ Tagify.prototype = {
var tagElems = [], _s = this.settings;

if( !tagsItems || tagsItems.length == 0 ){
// is mode is "select" clean all tags
// is mode is "select" clean all tagsargument of
if( _s.mode == 'select' )
this.removeAllTags()
return tagElems
Expand Down

0 comments on commit b503bed

Please sign in to comment.