From b503bed9c645c401d52f0a02e79b520fa8d5c755 Mon Sep 17 00:00:00 2001 From: vsync Date: Tue, 12 Jan 2021 13:55:31 +0200 Subject: [PATCH] [BUGFIX] #724 - when using "tagTextProp" setting, and typing a tag, without a whitelist, "value" property is set to "undefined" --- src/tagify.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tagify.js b/src/tagify.js index 582be53c..984277f1 100644 --- a/src/tagify.js +++ b/src/tagify.js @@ -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() @@ -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