-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix(orderlist): preserve original order when moving multi-selected items #8497
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(orderlist): preserve original order when moving multi-selected items #8497
Conversation
|
Thanks a lot for your contribution! But, PR does not seem to be linked to any issues. Please manually link to an issue or mention it in the description using #<issue_id>. |
2 similar comments
|
Thanks a lot for your contribution! But, PR does not seem to be linked to any issues. Please manually link to an issue or mention it in the description using #<issue_id>. |
|
Thanks a lot for your contribution! But, PR does not seem to be linked to any issues. Please manually link to an issue or mention it in the description using #<issue_id>. |
bd667c8 to
e0b5e6e
Compare
|
Fixed: 8497.mp4 |
|
Hi @melloware,
The fix simply sorts selected items by their original list index before reorder actions — no API changes. |
|
/assign me |
|
@melloware, ready to merge! |
| if (metaKey) { | ||
| const merged = [...selectionState, value]; | ||
|
|
||
| newSelection = merged.sort((a, b) => props.value.indexOf(a) - props.value.indexOf(b)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SHould we check if props.value is not undefined or null or else this will error? I didn't look at the rest of the code so not sure its even possible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested changes applied. Please take a look. Thanks!
|
Added a small defensive fallback for |
Defect Fix
This PR addresses a multi-selection ordering issue in OrderList where items selected out of sequence (e.g., Ctrl-click) were reordered incorrectly when moved to the top or bottom.
Summary of changes:
Normalize multi-selection by sorting selected items based on their original list index before reorder operations.
Ensures selected items always retain their visual order regardless of selection sequence.
Notes
This is a focused UX bug fix with no API changes.
Only components/orderlist/OrderList.js is affected.
Behavior now matches user expectations and native list reordering patterns.
Fixes: #8496
Fixed:#8496
Fixes: #8495
Fixed:#8495
(Duplicate due to ci error)