-
Notifications
You must be signed in to change notification settings - Fork 51
Zamoore/advanced table/column reordering 2 #2997
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
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
85fb190
to
433e9f4
Compare
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.
π’ π’ π’
π’ π’ π’
π’ π’ π’
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.
// If dropping to the right of the target, insert after the target | ||
// If dropping to the left of the target, insert before the target | ||
// Adjust for the shift in indices caused by removing the source column | ||
const adjustedIndex = |
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.
Suggestion: this is totally a style thing that you are more than welcome to ignore, but I find these nested ternaries harder than necessary to understand. I'd just opt for an if statement here.
packages/components/src/components/hds/advanced-table/models/row.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Lee White <[email protected]>
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.
WOOO! looks great π’
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.
π’ π
π Summary
If merged, this PR will add support for column reordering to the AdvancedTable component.
π οΈ Detailed description
columns
array is in OR may be explicitly set by passing in acolumnOrder
argument as an override.requestAnimationFrame
API to both resize and reorder actions. This helps prevent stuttering when these actions are being performed.onColumnReorder
callback function will be called with an array of column keys in the newly updated order.πΈ Screenshots
π External links
Jira ticket: HDS-4588
Figma file: [if it applies]
π Component checklist
π¬ Please consider using conventional comments when reviewing this PR.
π PCI review checklist
Examples of changes to controls include access controls, encryption, logging, etc.
Examples include changes to operating systems, ports, protocols, services, cryptography-related components, PII processing code, etc.