Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Commit bf9487f

Browse files
committed
Tagging - Trim the selected string item
When taggingLabel is used a space is inserted between search and the taggingLabel. When the item is pushed to the selected array, only the tagginLabel is removed. Not the extra space
1 parent 49df37a commit bf9487f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/select.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@
385385
// for `item` if it is a detected duplicate
386386
if ( item === undefined ) return;
387387
// create new item on the fly
388-
item = ctrl.tagging.fct !== undefined ? ctrl.tagging.fct(ctrl.search) : item.replace(ctrl.taggingLabel,'');
388+
item = ctrl.tagging.fct !== undefined ? ctrl.tagging.fct(ctrl.search) : item.replace(ctrl.taggingLabel,'').trim();
389389
}
390390
}
391391
// search ctrl.selected for dupes potentially caused by tagging and return early if found

0 commit comments

Comments
 (0)