-
Notifications
You must be signed in to change notification settings - Fork 34
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 column growth issue in Data tables #2309
Conversation
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.
One comment. Seems good though! 👍
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's a lot going on in here that I don't really understand doing an async PR review. If we need to do a more thorough review, I can setup a meeting. Otherwise, it looks fine. I assume these changes work.
Co-authored-by: Kevin Ghadyani <[email protected]>
This PR addresses an issue that @sherizada-okta discovered, in which the resize handle was offset when resizing columns in Data Table:
This issue was present in both the original
DataTable
implementation and the rebuiltDataView
implementation.Solution
The cells in each row adjust to fit the space allotted to them. The final cell expands to fill the remaining space in the table.
In the body rows, this width is the same, since the structure of each cell is identical across rows.
In the table head, however, the "Actions" column has a different width because it does not include the action buttons present in the body cells of the same column.
To fix this, I borrowed a solution from the drag handle column — in the table head, we now render an invisible set of action buttons to match the row actions in the body. This ensures that the column has the same width.
This PR also fixes a regression in which the resize handle was being disabled by an unrelated CSS change.