How to prevent copying of pasted values ​​into ui-select in AngularJS

I have a dropdown list and a ui-select . based on the values ​​of the dropdown ui-select values ​​are required. but if I directly paste these specific values ​​into ui-select , it is displayed as selected. how can we prevent ui-select from copying values?

Example

shown below.

Select request
  <div class="dropdown-Finding"> <ui-select class="form-control dropdown-reviwerFinding-select" id="searchBarArea" onkeypress="return false;" multiple tagging tagging-label="false" ng-model="QiReviewerFindingType.selectedItems" theme="bootstrap"> <ui-select-match placeholder="Select Reviewer Findings">{{$item.ShortDescription}}</ui-select-match> <ui-select-choices repeat="qiQueryFinding in qiQueryFindings | filter:$select.search"> {{qiQueryFinding.ShortDescription}} </ui-select-choices> </ui-select> <span class="carat" open-menu-by-click="searchBarArea"></span> </div> 
+6
source share
1 answer

http://plnkr.co/edit/BVaXpviCACi5sd3aw9oX?p=preview

Use this kind of code.

 <ui-select ng-model="ctrl.person.selected" theme="select2" on-select="ctrl.onSelectCallback($item, $model)" ng-disabled="ctrl.disabled" style="min-width: 300px;" title="Choose a person"> <ui-select-match placeholder="Select a person in the list or search his name/age...">{{$select.selected.name}}</ui-select-match> <ui-select-choices repeat="person.email as person in ctrl.people | propsFilter: {name: $select.search, age: $select.search}"> <div ng-bind-html="person.name | highlight: $select.search"></div> <small> email: {{person.email}} age: <span ng-bind-html="''+person.age | highlight: $select.search"></span> </small> </ui-select-choices> 

I tried to figure out the exact difference, but could not. But maybe the above sample will help you.

0
source

Source: https://habr.com/ru/post/1011935/


All Articles