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 +5
-2
lines changed Top Open diff view settings Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Top Open diff view settings Original file line number Diff line number Diff line change @@ -388,6 +388,9 @@ uis.controller('uiSelectCtrl',
388388 return isDisabled ;
389389 } ;
390390
391+ function _replaceTaggingLabelAndTrim ( item , taggingLabel ) {
392+ return item . replace ( taggingLabel , '' ) . trim ( ) ;
393+ }
391394
392395 // When the user selects an item with ENTER or clicks the dropdown
393396 ctrl . select = function ( item , skipFocusser , $event ) {
@@ -431,7 +434,7 @@ uis.controller('uiSelectCtrl',
431434 // if item type is 'string', apply the tagging label
432435 } else if ( typeof item === 'string' ) {
433436 // trim the trailing space
434- item = item . replace ( ctrl . taggingLabel , '' ) . trim ( ) ;
437+ item = _replaceTaggingLabelAndTrim ( item , ctrl . taggingLabel ) ;
435438 }
436439 }
437440 }
@@ -441,7 +444,7 @@ uis.controller('uiSelectCtrl',
441444 return ;
442445 }
443446 } else if ( typeof item === 'string' ) {
444- item = item . replace ( ctrl . taggingLabel , '' ) . trim ( ) ;
447+ item = _replaceTaggingLabelAndTrim ( item , ctrl . taggingLabel ) ;
445448 }
446449 _resetSearchInput ( ) ;
447450 $scope . $broadcast ( 'uis:select' , item ) ;
You can’t perform that action at this time.
0 commit comments