Skip to content
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

feat(table): added frozen header, frozen column, permanent scrollbars #2464

Open
wants to merge 7 commits into
base: 18.4.0
Choose a base branch
from

Conversation

ArtBlue
Copy link
Contributor

@ArtBlue ArtBlue commented Oct 9, 2024

Fixes #2457

  • This PR contains CSS changes
  • This PR does not contain CSS changes

Description

Added the next set of features to table:

  • added frozen header
  • added full height table modifier
  • added frozen column
  • added full height table override
  • added permanent scrollbars

Notes

For the permanent scrollbars, I created a utility mixin to be used by a public utility class as well as intrinsically for table without the use of the utility class.

Screenshots

image

image

image

Checklist

  • I verify the build is in a non-broken state
  • I verify all changes are within scope of the linked issue
  • I regenerated all CSS files under dist folder
  • I tested the UI in all supported browsers
  • I did a visual regression check of the components impacted by doing a Percy build and approved the build
  • I tested the UI in dark mode and RTL mode
  • I added/updated/removed Storybook coverage as appropriate

Copy link

changeset-bot bot commented Oct 9, 2024

🦋 Changeset detected

Latest commit: 82fe1dd

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@ebay/skin Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@@ -64,6 +68,34 @@ $density-relaxed-img-radius: 8px;
padding: $density-relaxed-padding;
}

.table--frozen-header thead {

Choose a reason for hiding this comment

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

I might not have full context, but I am see everywhere else using sticky instead of frozen even in figma playbook.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We aren't necessarily bound to the vernacular of DS. We chart our own course for what makes sense for the web/users. Often times, DS actually reevaluates their terminology and follows suit as well.

I used frozen instead of sticky since that is par for the course on user-level understanding of table cells. We can rename if needed, but I'm not seeing the naming as an issue.

@@ -131,6 +163,11 @@ $density-relaxed-img-radius: 8px;
text-align: center;
width: 48px;
}
/* Not sure of downstream dev consumers' ability to utilize this.
Convert to long-hand if problematic. */
.table--mode-selection tr:has(input:checked) :where(td, th) {

Choose a reason for hiding this comment

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

Did you include this by accident? Looks unrelated to the PR.

Also, :has only has 91.66% global compatibility: https://caniuse.com/css-has

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not an accident. This is to highlight the row on selection. Are you pulling down PRs locally when you review?

This doesn't impact function and is purely decorative. We do use :has for similar types of progressive enhancements, for which current level of support is not really an issue.

Choose a reason for hiding this comment

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

Got you. Just do not see the change in PR title and description.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The markup was already done for selection. This is just a styling change; not all of those are specified granularly in PRs. No worries. Better safe than sorry. 😄

@@ -64,6 +68,34 @@ $density-relaxed-img-radius: 8px;
padding: $density-relaxed-padding;
}

.table--frozen-header thead {
position: sticky;
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this solution also work with dropdowns inside the cell?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. Let me implement the full markup inside with open dropdowns and check. If it doesn't, I'll check for a css solution, but we may end up having to do something via js in ebay ui.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@agliga , it works fine, at least with listbox. I have a feeling the issues the other team was having had to do with incorrect z-index and lack of background-color on <thead> and all other non-data columns (outer wrapper).

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants