fix(table): updated expandable to animate visibility#7537
fix(table): updated expandable to animate visibility#7537mcoker merged 13 commits intopatternfly:mainfrom
Conversation
|
Preview: https://patternfly-pr-7537.surge.sh A11y report: https://patternfly-pr-7537-a11y.surge.sh |
thatblindgeye
left a comment
There was a problem hiding this comment.
Tested this against the React PR that resolves the divider issue patternfly/patternfly-react#11815 and it mostly looks good. The one thing I'm noticing is when you click to collapse a table row, the divider line appears as the expandable row is collapsing (causing the table to look like it has an empty row momentarily). I think it's really only noticeable at 25 or 10% animation speed, though.
My mac isn't currently letting my screen record so pictures instead:
Does it have to do with the
|
|
There's a problem with the compound expansion example - looks like maybe changing them to visibility instead of display:none means they are taking space. |
thatblindgeye
left a comment
There was a problem hiding this comment.
Other than ^ lgtm, animations work nicely when pulled into React (with the fixes for the divider bug that got merged in react)
|
@srambach can you check again? I'm assuming we should animate compound expandable, too? At least the initial click on a compound expandable item, but also possibly a fade between items once one is expanded when clicking on a different item. cc @andrew-ronaldson wdyt? Here's a link to compound expandable in react - https://www.patternfly.org/components/table/react/compound-expandable/ |
srambach
left a comment
There was a problem hiding this comment.
It looks like compound expandable shows all the non-expanded rows unless .pf-m-animate-expand is on the table. Are we keeping display: none in that case so we don't break core users?
Also, I think we need to add .pf-m-animate-expand in the docs at the appropriate spot.
| | `.pf-v6-c-table__control-row` | `.pf-v6-c-table__expandable > <tr>` | Modifies a compound expandable table control row. | | ||
| | `.pf-m-expanded` | `<tbody>`, `.pf-v6-c-table__compound-expansion-toggle` > `.pf-v6-c-button` | Modifies a tbody with a row and an expandable row. | | ||
| | `.pf-v6-c-table__compound-expansion-toggle` | `<td>` | Modifies a `<td>` on active/focus. | | ||
| | `.pf-m-expanded` | `<tbody>`, `.pf-v6-c-table__compound-expansion-toggle` > `.pf-v6-c-button` | Modifies a tbody with a row and an expandable row. | |
There was a problem hiding this comment.
This wording is confusing - modifies a tbody that contains ... and an expanded toggle (?)
There was a problem hiding this comment.
That was already there (I didn't add it) but I took a stab. It looks like the selectors were wrong, too.
| | `.pf-m-expanded` | `<tbody>`, `.pf-v6-c-table__compound-expansion-toggle` > `.pf-v6-c-button` | Modifies a tbody with a row and an expandable row. | | ||
| | `.pf-v6-c-table__compound-expansion-toggle` | `<td>` | Modifies a `<td>` on active/focus. | | ||
| | `.pf-m-expanded` | `<tbody>`, `.pf-v6-c-table__compound-expansion-toggle` > `.pf-v6-c-button` | Modifies a tbody with a row and an expandable row. | | ||
| | `.pf-m-no-background` | `.pf-v6-c-table__expandable-row-content` | Modifies the expandable row content to have a transparent background. For in compound expandable when the parent expandable row has no padding with `.pf-m-no-padding`. | |
There was a problem hiding this comment.
| | `.pf-m-no-background` | `.pf-v6-c-table__expandable-row-content` | Modifies the expandable row content to have a transparent background. For in compound expandable when the parent expandable row has no padding with `.pf-m-no-padding`. | | |
| | `.pf-m-no-background` | `.pf-v6-c-table__expandable-row-content` | Modifies the expandable row content to have a transparent background. For use in compound expandable when the parent expandable row has no padding with `.pf-m-no-padding`. | |
| &:not(.pf-m-expanded) { | ||
| display: none; |
There was a problem hiding this comment.
Does this need to remain or use another method to hide rows that aren't expanded?
There was a problem hiding this comment.
Added back, missed that completely. That hides the non-expanded rows in a non-expandable table.
|
@srambach thanks! I should have caught the non-animated rows showing! Updated and added new examples with the animated class for regular and compound expandable. |
thatblindgeye
left a comment
There was a problem hiding this comment.
Repeat from Slack convo below, but a couple things I'm noticing when pulling these updates into React with updates made there:
- In Core we need to apply the
pf-m-animate-expandclass to the outer table element. Doing that will show an issue seen in React where when anything but the 1st compound expandable section is expanded, there's a border above the expandable content. I assume it's due to sometr + trselector not taking into account this animate-expand modifier? The core compound expandable looks fine when updating the classes so the second compound expansion button+content is expanded, it's not until you add the missingpf-m-animate-expandto the outer table where you can reproduce the issue - If content within the
pf-v6-c-table__expandable-row-contentelement has a margin (as it does in React examples/demos for compound expansion), that margin continues to take up space when collapsed. Updating the React examples/demos to use the padding utility class instead of the margin one should resolve the issue, but just wondering if we want to handle a case of margin being used.
Not from Slack, but also examples will need to be updates so that hidden and inert are added to the collapsed rows.
|
I think now the top padding is missing on tabs that aren't the first one? You can see in the inspector that 2025-06-11_10-24-34.mp4 |
thatblindgeye
left a comment
There was a problem hiding this comment.
Looks good when linked to my React draft!
srambach
left a comment
There was a problem hiding this comment.
I'm good with a follow-on later to see if we can improve the bounce when switching from one compound expandable to another.
|
🎉 This PR is included in version 6.3.0-prerelease.28 🎉 The release is available on: Your semantic-release bot 📦🚀 |


fixes #7536