manywho / ui-bootstrap

5 stars 3 forks source link

Feature/FLOW-2267 Comboboxes reverse the order of items when there is a selected value #169

Closed BenKF closed 3 years ago

BenKF commented 3 years ago

issue: order of options in the combo box was reversing before you selected an item reason: addOptions was reversing the list of options every time it was called it gets called only once on line 91 if you have nothing selected - therefore the list is reversed but it gets called a second time on line 96 if you have something selected - therefore the list was no longer reversed why it only affected data from a service: if you don't have something selected but get it from a List rather than a service state.objectData is an empty list rather than null so the condition on line 94 passes as if you had something selected

my changes mean that only the selected items are reversed (so the most recently selected item is at the top) my changes also fix an issue where the next page of items was being prepended and reversed as if they were the selected items, now there is a flag to append the next page (append = true) or prepend the selected items in reverse order (append = false)