Skip to content

Commit 41ba28f

Browse files
author
Brian Feister
committed
make sure the tagging tranform function is called if available
1 parent 6126585 commit 41ba28f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/select.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,10 +403,12 @@
403403
// ctrl.tagging pushes items to ctrl.items, so we only have empty val
404404
// for `item` if it is a detected duplicate
405405
if ( item === undefined ) return;
406+
406407
// create new item on the fly if we don't already have one;
407-
// use tagging function if we have one, otherwise, push a string
408-
if ( ctrl.tagging.fct !== undefined && item === undefined ) {
408+
// use tagging function if we have one
409+
if ( ctrl.tagging.fct !== undefined && typeof item === 'string' ) {
409410
item = ctrl.tagging.fct(ctrl.search);
411+
// if item type is 'string', apply the tagging label
410412
} else if ( typeof item === 'string' ) {
411413
item = item.replace(ctrl.taggingLabel,'');
412414
}

0 commit comments

Comments
 (0)