Align calculated column widths with cell padding in DetailsList#5769
Align calculated column widths with cell padding in DetailsList#5769dzearing merged 5 commits intomicrosoft:masterfrom
Conversation
kenotron
left a comment
There was a problem hiding this comment.
npm run update-snapshots
| ): IColumn[] { | ||
| const { selectionMode, checkboxVisibility, groups } = props; | ||
| const outerPadding = DEFAULT_INNER_PADDING; | ||
| const outerPadding = DEFAULT_ROW_HORIZONTAL_PADDING * 2; |
There was a problem hiding this comment.
Not too familiar with this bit here, but since we now pass these in as props, should we then use props.rowHorizontalPadding here?
There was a problem hiding this comment.
@kenotron In DetailsList.base.tsx they are coming from simply importing them from the DetailsRow.styles and not passed by props)))
Vitalius1
left a comment
There was a problem hiding this comment.
@ThomasMichon FYI: the 12px padding left you are changing originated from this PR 4857. Make sure you are not causing any visual bugs in that area instead.
|
@Vitalius1 It would appear that PR #4857 likely caused the visual bugs, by creating this misalignment in the first place. We can have the padding be |
There was a problem hiding this comment.
@ThomasMichon Even though you've consolidated the source of this 2 constants it still feels like we have other ones scattered across all files. In the future would be a good idea to have a file called something like StyleConstants.ts at the root of the DetailsList folder exporting all of them from one place.
373102c to
0eac3f5
Compare
0eac3f5 to
4ae338f
Compare
|
I updated the left padding to |
|
The screener's detailslist change seemed to have made it wider... not sure why... |
|
Hm. The column headers being wider is intended, but the |
4ae338f to
22fdfec
Compare
|
Hey @aditima, I need your sign-off for this, I guess! Also, who approves Screener updates? You'll notice the current versions look better! |
|
@betrue-final-final approves screener updates :) |
Overview
This change fixes a regression in the alignment of cell padding in
DetailsListwith the calculated column widths. Specifically, the calculation was not providing enough room for the larger cell padding values, resulting in icon columns experiencing overflow and the whole row being miscalculated.Details
Added a
rowHorizontalWidthandisPaddedMarginto the props and style props ofDetailsRow,DetailsHeader, andDetailsRowfields, optional, but provided overall byDetailsList. These are fed into thegetStylescalculations, ensuring that everything aligns, and that the values may be overridden if desired.Changed the
paddingLeftstyles of cells to berowHorizontalPaddinginstead of12px. This means the left-padding goes from12pxto8px, bu now there are no more visual bugs.Microsoft Reviewers: Open in CodeFlow