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 +13
-9
lines changed Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change 604
604
605
605
$scope . $apply ( function ( ) {
606
606
var processed = false ;
607
+ var tagged = false ;
607
608
608
609
if ( ctrl . multiple && KEY . isHorizontalMovement ( key ) ) {
609
610
processed = _handleMatchSelection ( key ) ;
616
617
if ( ctrl . taggingTokens . tokens [ i ] === KEY . MAP [ e . keyCode ] ) {
617
618
// make sure there is a new value to push via tagging
618
619
if ( ctrl . search . length > 0 ) {
619
- $timeout ( function ( ) {
620
- _searchInput . triggerHandler ( 'tagged' , ctrl . items ) ;
621
- var newItem = ctrl . search . replace ( KEY . MAP [ e . keyCode ] , '' ) . trim ( ) ;
622
- if ( ctrl . tagging . fct ) {
623
- newItem = ctrl . tagging . fct ( newItem ) ;
624
- }
625
- ctrl . select ( newItem , true ) ;
626
- } ) ;
620
+ tagged = true ;
627
621
}
628
622
}
629
623
}
624
+ if ( tagged ) {
625
+ $timeout ( function ( ) {
626
+ _searchInput . triggerHandler ( 'tagged' , ctrl . items ) ;
627
+ var newItem = ctrl . search . replace ( KEY . MAP [ e . keyCode ] , '' ) . trim ( ) ;
628
+ if ( ctrl . tagging . fct ) {
629
+ newItem = ctrl . tagging . fct ( newItem ) ;
630
+ }
631
+ ctrl . select ( newItem , true ) ;
632
+ } ) ;
633
+ }
630
634
}
631
635
}
632
636
662
666
// taggingLabel === false bypasses all of this
663
667
if ( ctrl . taggingLabel === false ) return ;
664
668
665
- var items = angular . copy ( ctrl . items )
669
+ var items = angular . copy ( ctrl . items ) ;
666
670
var stashArr = angular . copy ( ctrl . items ) ;
667
671
var newItem ;
668
672
var item ;
You can’t perform that action at this time.
0 commit comments