fix(table): correct alignment with a table cell that contains a button#7551
Conversation
|
Preview: https://patternfly-pr-7551.surge.sh A11y report: https://patternfly-pr-7551-a11y.surge.sh |
srambach
left a comment
There was a problem hiding this comment.
WDYT about mobile view? @andrew-ronaldson

|
Good question. I'd prefer if the button was |
|
@andrew-ronaldson I updated the mobile view so that the |
c324ea9 to
5aa786f
Compare
srambach
left a comment
There was a problem hiding this comment.
Just one nit on the name - if that's good then it all looks good to me!
| | `.pf-v6-c-table__check` | `<th>`, `<td>` | Initiates a checkbox or radio input table cell. | | ||
| | `.pf-v6-c-table__action` | `<th>`, `<td>` | Initiates an action table cell. | | ||
| | `.pf-v6-c-table__inline-edit-action` | `<th>`, `<td>` | Initiates an inline edit action table cell. | | ||
| | `.pf-v6-c-table__td-button` | `<td>` | Initiates an table cell with button. | |
There was a problem hiding this comment.
Just want to get @mcoker's thought about the name of this element - this is a tough one and I feel like it should be pf-v6-c-table__td--button (double hyphen) but I am not sure.
mcoker
left a comment
There was a problem hiding this comment.
I would probably call that "action" instead of button since it can hold anything form-element size, which would most likely be buttons and menu toggles, and we generally refer to those as actions instead of buttons. We already have __action as the action cell, but I think .pf-m-action would work since it's more generic to denote any cell has an action (or actions), and you can have multiple of them, compared to __action which is the action cell for the row. wdyt?
Yeah, I think that makes sense to me |
| --#{$table}__td-button--PaddingBlockStart: var(--pf-t--global--spacer--sm); | ||
| --#{$table}__td-button--PaddingBlockEnd: var(--pf-t--global--spacer--sm); | ||
|
|
||
| // * Table compact cell with button | ||
| --#{$table}--m-compact__td-button--PaddingBlockStart: var(--pf-t--global--spacer--xs); | ||
| --#{$table}--m-compact__td-button--PaddingBlockEnd: var(--pf-t--global--spacer--xs); |
There was a problem hiding this comment.
Should these variable names also change to --m-action ?
There was a problem hiding this comment.
These are now updated with modifier name
mcoker
left a comment
There was a problem hiding this comment.
lgtm! Just a couple of small comments
| --#{$table}--cell--PaddingBlockEnd: var(--#{$table}--m-compact__action--PaddingBlockEnd); | ||
| } | ||
|
|
||
| .pf-m-action { |
There was a problem hiding this comment.
Can you tie this modifier class to the table element it applies to?
| .pf-m-action { | |
| .#{$table}__td.pf-m-action { |
| 6 | ||
| {{/table-td}} | ||
| {{#> table-td table-td--data-label="Start Build" table-td--modifier="pf-m-action"}} | ||
| <span class="pf-v6-c-table__text"> |
There was a problem hiding this comment.
Can you make this a regular <span>? the __text element works, but it's more intended for use with the modifiers that manipulate text (nowrap, truncate, etc)
| <span class="pf-v6-c-table__text"> | |
| <span> |
| 2 | ||
| {{/table-td}} | ||
| {{#> table-td table-td--data-label="Start Build" table-td--modifier="pf-m-action"}} | ||
| <span class="pf-v6-c-table__text"> |
There was a problem hiding this comment.
| <span class="pf-v6-c-table__text"> | |
| <span> |
| 7 | ||
| {{/table-td}} | ||
| {{#> table-td table-td--data-label="Start Build" table-td--modifier="pf-m-action"}} | ||
| <span class="pf-v6-c-table__text"> |
There was a problem hiding this comment.
| <span class="pf-v6-c-table__text"> | |
| <span> |
|
🎉 This PR is included in version 6.3.0-prerelease.36 🎉 The release is available on: Your semantic-release bot 📦🚀 |



#7534
Adds a new html example of
tabletdcells that contain abutton. A new modifier class sets cell padding so the button is aligned within the row of elements.https://patternfly-pr-7551.surge.sh/components/table/html/table-with-buttons-and-actions/