Skip to content

Commit

Permalink
Fix #5177: Orderlist move top and bottom keep order (#5178)
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware authored Oct 27, 2023
1 parent fdfc75f commit 13ff138
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/lib/orderlist/OrderListControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const OrderListControls = React.memo((props) => {
if (props.selection) {
let value = [...props.value];

for (let i = 0; i < props.selection.length; i++) {
for (let i = props.selection.length - 1; i >= 0; i--) {
const selectedItem = props.selection[i];
const selectedItemIndex = ObjectUtils.findIndexInList(selectedItem, value, props.dataKey);

Expand Down Expand Up @@ -103,7 +103,7 @@ export const OrderListControls = React.memo((props) => {
if (props.selection) {
let value = [...props.value];

for (let i = props.selection.length - 1; i >= 0; i--) {
for (let i = 0; i < props.selection.length; i++) {
let selectedItem = props.selection[i];
let selectedItemIndex = ObjectUtils.findIndexInList(selectedItem, value, props.dataKey);

Expand Down

0 comments on commit 13ff138

Please sign in to comment.