This repository was archived by the owner on Oct 2, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 393
393
if ( ctrl . taggingLabel === false ) {
394
394
if ( ctrl . activeIndex < 0 ) {
395
395
item = ctrl . tagging . fct !== undefined ? ctrl . tagging . fct ( ctrl . search ) : ctrl . search ;
396
- if ( angular . equals ( ctrl . items [ 0 ] , item ) ) {
396
+ if ( ! item || angular . equals ( ctrl . items [ 0 ] , item ) ) {
397
397
return ;
398
398
}
399
399
} else {
412
412
// use tagging function if we have one
413
413
if ( ctrl . tagging . fct !== undefined && typeof item === 'string' ) {
414
414
item = ctrl . tagging . fct ( ctrl . search ) ;
415
+ if ( ! item ) return ;
415
416
// if item type is 'string', apply the tagging label
416
417
} else if ( typeof item === 'string' ) {
417
418
// trim the trailing space
668
669
if ( ctrl . tagging . fct ) {
669
670
newItem = ctrl . tagging . fct ( newItem ) ;
670
671
}
671
- ctrl . select ( newItem , true ) ;
672
+ if ( newItem ) ctrl . select ( newItem , true ) ;
672
673
} ) ;
673
674
}
674
675
}
751
752
if ( stashArr . filter ( function ( origItem ) { return angular . equals ( origItem , ctrl . tagging . fct ( ctrl . search ) ) ; } ) . length > 0 ) {
752
753
return ;
753
754
}
755
+ newItem . isTag = true ;
754
756
// handle newItem string and stripping dupes in tagging string context
755
757
} else {
756
758
// find any tagging items already in the ctrl.items array and store them
You can’t perform that action at this time.
0 commit comments