Is there a way to automatically rearrange the order of selected items in AngularJS ui-select multiple?
Check out this code snippet, with more examples available on ui-select github
<ui-select multiple ng-model="ctrl.multipleDemo.colors" theme="bootstrap" ng-disabled="ctrl.disabled" close-on-select="false" style="width: 300px;" title="Choose a color">
<ui-select-match placeholder="Select colors...">{{$item}}</ui-select-match>
<ui-select-choices repeat="color in ctrl.availableColors | filter:$select.search">
{{color}}
</ui-select-choices>
Here is a snapshot of its behavior :
https://i.sstatic.net/SoHSy.png
What I want is for the selected items to be reordered: even if I selected Yellow, Green, and then Blue, I would like them to display as Blue, Green, Yellow.
I have come across an attribute called sortable="true" but it doesn't seem to achieve the desired result.