diff --git a/dist/select.js b/dist/select.js index afbd4350b..f5a88ab08 100644 --- a/dist/select.js +++ b/dist/select.js @@ -632,17 +632,17 @@ uis.controller('uiSelectCtrl', if ( ctrl.activeIndex === 0 ) { // ctrl.tagging pushes items to ctrl.items, so we only have empty val // for `item` if it is a detected duplicate - if ( item === undefined ) return; - - // create new item on the fly if we don't already have one; - // use tagging function if we have one - if ( ctrl.tagging.fct !== undefined && typeof item === 'string' ) { - item = ctrl.tagging.fct(item); - if (!item) return; - // if item type is 'string', apply the tagging label - } else if ( typeof item === 'string' ) { - // trim the trailing space - item = item.replace(ctrl.taggingLabel,'').trim(); + if ( item !== undefined ) { + // create new item on the fly if we don't already have one; + // use tagging function if we have one + if ( ctrl.tagging.fct !== undefined && typeof item === 'string' ) { + item = ctrl.tagging.fct(item); + if (!item) return; + // if item type is 'string', apply the tagging label + } else if ( typeof item === 'string' ) { + // trim the trailing space + item = item.replace(ctrl.taggingLabel,'').trim(); + } } } } @@ -2245,4 +2245,4 @@ $templateCache.put("select2/select-multiple.tpl.html","
"); $templateCache.put("selectize/choices.tpl.html","
"); $templateCache.put("selectize/match.tpl.html","
"); -$templateCache.put("selectize/select.tpl.html","
");}]); \ No newline at end of file +$templateCache.put("selectize/select.tpl.html","
");}]);