E535 fix(Table): remove duplicate bottom border on mobile collapsed expandable rows by evwilkin · Pull Request #6698 · patternfly/patternfly · GitHub
[go: up one dir, main page]

Skip to content

fix(Table): remove duplicate bottom border on mobile collapsed expandable rows#6698

Merged
mattnolting merged 5 commits intopatternfly:v6from
evwilkin:fix/6556-table-border
Jul 2, 2024
Merged

fix(Table): remove duplicate bottom border on mobile collapsed expandable rows#6698
mattnolting merged 5 commits intopatternfly:v6from
evwilkin:fix/6556-table-border

Conversation

@evwilkin
Copy link
Member

Closes #6556

This PR removes the bottom border on collapsed expandable rows on mobile, which is causes a double border to appear.

@patternfly-build
Copy link
Collaborator
patternfly-build commented May 28, 2024

@evwilkin evwilkin linked an issue May 28, 2024 that may be closed by this pull request
Copy link
Member
@srambach srambach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🐸

Copy link
@kaylachumley kaylachumley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good!

Copy link
Collaborator
@mattnolting mattnolting left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This update removes more borders than I believe are intended.

Before:

Screenshot 2024-06-01 at 8 46 54 AM

After:

Screenshot 2024-06-01 at 8 47 01 AM


// * Table tr responsive
--#{$table}__tr--responsive--border-width--base: var(--pf-t--global--border--width--divider--default);
--#{$table}__tr--responsive--border-width--base: 0;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
--#{$table}__tr--responsive--border-width--base: 0;
--#{$table}__tr--responsive--border-width--base: var(--pf-t--global--border--width--divider--default);

@evwilkin
Copy link
Member Author
evwilkin commented Jun 4, 2024

Suggestions above are correct that the previous code changed more than the intended target, but the proposed solution looks to revert the original problem this PR aims to solve.

The issue is that:

  • expandable tables contain tbody that always has a bottom border
  • Child tr which has a bottom border when the tbody is not expanded (the double border)

There are several rules similar to this case, but all focus on the tr whereas we need to focus on the class on the parent table and go from there so I have added a new style rule. Note - I believe this new rule can replace the rule below it, which doesn't look to apply any changes as the nesting is causing the table component selector to be added twice?

@evwilkin evwilkin requested review from mattnolting and srambach June 4, 2024 20:58
Comment on lines +180 to +184
// Remove border on tr inside non-expanded tbody in of expandable tables
&.pf-m-expandable tbody:not(.pf-m-expanded) tr {
border-block-end: 0;
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does what we want, but something like this would be more straightforward. Disable all <tr> border-block-end. Initially, this logic applied to a mix and match approach to expandable table (tbody.expandable next to a regular row). However, React's guidance places all expandable table content in a loop, within a Tbody. I believe it's safe to take this approach.

Add this variable to :root (.#{$table}[class*="pf-m-grid"] in this case) to avoid potential conflicts

--#{$table}__tbody--responsive--m-expandable--BorderBlockEndWidth: var(--pf-t--global--border--width--divider--default);
  &.pf-m-expandable {
    --#{$table}__tr--BorderBlockEndWidth: 0; // nested table rows have no border

    .#{$table}__tbody {
      border-block-end: var(--#{$table}__tbody--responsive--border-width) solid var(--#{$table}--responsive--BorderColor);
    }
  }

You should then be able to remove lines 190-199 and lines 201-212, but because pf-v-table is very complex, we should run a visual regression test before merging.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mattnolting I've made these changes but noticed I also needed to specifically target .#{$table}__tbody.pf-m-expanded to apply as needed so added that specific rule to what you laid out above 👍

Copy link
Collaborator
@mattnolting mattnolting left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wonderful. Last thing, I believe you can remove lines 299 - 300. Looks like the padding between rows is uneven. @kaylachumley Can you confirm?

Before

Screenshot 2024-06-25 at 10 13 31 AM

After

Screenshot 2024-06-25 at 10 38 06 AM

@kaylachumley
Copy link

yep! That looks better. can confirm to remove rows 299-300! @mattnolting

@evwilkin
Copy link
Member Author
evwilkin commented Jul 1, 2024

Thanks @mattnolting for the help! Just removed lines 299-300 🤞

Wonderful. Last thing, I believe you can remove lines 299 - 300. Looks like the padding between rows is uneven.

Copy link
Collaborator
@mattnolting mattnolting left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LPTM 🤖

@mattnolting mattnolting merged commit db11a43 into patternfly:v6 Jul 2, 2024
@patternfly-build
Copy link
Collaborator

🎉 This PR is included in version 6.0.0-alpha.179 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

Table - remove extra border on mobile collapsed expandable rows

5 participants

0