Skip to content
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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

shleewhite
Copy link
Contributor

📌 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
Screenshot 2025-03-11 at 4 07 27 PM

After
Screenshot 2025-03-11 at 4 18 38 PM


👀 Component checklist

💬 Please consider using conventional comments when reviewing this PR.

@shleewhite shleewhite requested a review from a team as a code owner March 11, 2025 20:21
Copy link

vercel bot commented Mar 11, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
hds-showcase ✅ Ready (Inspect) Visit Preview Mar 11, 2025 8:44pm
hds-website ✅ Ready (Inspect) Visit Preview Mar 11, 2025 8:44pm

// 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 ' : '';
Copy link
Contributor

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.

Copy link
Contributor Author

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?

Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants