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 604604
605605 $scope . $apply ( function ( ) {
606606 var processed = false ;
607+ var tagged = false ;
607608
608609 if ( ctrl . multiple && KEY . isHorizontalMovement ( key ) ) {
609610 processed = _handleMatchSelection ( key ) ;
616617 if ( ctrl . taggingTokens . tokens [ i ] === KEY . MAP [ e . keyCode ] ) {
617618 // make sure there is a new value to push via tagging
618619 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 ;
627621 }
628622 }
629623 }
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+ }
630634 }
631635 }
632636
662666 // taggingLabel === false bypasses all of this
663667 if ( ctrl . taggingLabel === false ) return ;
664668
665- var items = angular . copy ( ctrl . items )
669+ var items = angular . copy ( ctrl . items ) ;
666670 var stashArr = angular . copy ( ctrl . items ) ;
667671 var newItem ;
668672 var item ;
You can’t perform that action at this time.
0 commit comments