-
Notifications
You must be signed in to change notification settings - Fork 47
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
AdvancedTable: explicitly set select checkbox column width #2761
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
// if there is a select checkbox, the first column is 'auto' width to hug the checkbox content | ||
let style = isSelectable ? 'auto' : ''; | ||
// if there is a select checkbox, the first column is 'min-content' width to hug the checkbox content | ||
let style = isSelectable ? 'min-content ' : ''; |
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.
Technically in Figma this is element is 48x48px, which referencing the showcase the dimensions are 49x48.
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.
@jorytindall does that include the border?
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.
@shleewhite good point, Figma doesn't visually represent the DOM in the same way, so no, that doesn't include the border; technically the border is "inside" of the element, which is a conceptual difference.
📌 Summary
If merged, this PR would fix an issue the explorer table had when converting to AdvancedTable. Basically, because every column in explorer has a set pixel width, if the user hides many columns then the checkbox column grows to fill the available space.
We also know that the select checkbox column is 50px wide since there is never any text and consumers cannot control the content of the cells in this column.
This PR also adds an example to the showcase that mimics the explorer use case.
📸 Screenshots
Before

After

👀 Component checklist
💬 Please consider using conventional comments when reviewing this PR.