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

[Table Skeleton state incorrect]: When setting the data table to skeleton "mode" the row cells and header cells don't have the correct styling. #2697

Open
KlapTrap opened this issue Sep 12, 2023 · 1 comment

Comments

@KlapTrap
Copy link

The issues

Expectation:

Screenshot 2023-09-12 at 13 47 55

See the react storybook for reference: https://react.carbondesignsystem.com/?path=/story/components-datatable-skeleton--skeleton&globals=theme:white

Actual:

Screenshot 2023-09-12 at 13 47 46

See the angular storybook https://angular.carbondesignsystem.com/?path=/story/components-table--skeleton

There are three main things that need to be fixed:

  1. The sortable header cells should not be intractable and should not have the skeleton loading state applied.

There are a few things going wrong here, 1. is that the buttons that handle sorting in the header need to be hidden and replaced with the static headers and, 2. the .cds--data-table--sort class needs to be removed from the table to avoid the extra padding in the header.

  1. The body cell should have the skeleton loading state applied

Looking at the @carbon/styles package source, it expects there to be a span inside the body row cell when the table is in the skeleton state. The fix here might be as easy as adding <span *ngIf="skeleton"></span> to the end of the table-data.component.ts template.

  1. Expandable rows need to have their expand button hidden.
  2. The skeleton state isn't applied to the peripheral components like the title and toolbar.

There may be other issues but these are the main ones I'm seeing.

Possible solutions

  1. Apply the fixes to the current data table component
  2. Follow the same path as the react team and add a dedicated skeleton table component and remove it from the base datatable
    a. This would align the library with the core react library and simplify the logic in the base data table (a lot of *ngIf="!skeleton" scattered around the code at the moment that could be removed) but might be considered a worst developer experience.

I'm happy to create a PR for either options, wdyt?

@peetritense
Copy link

Either option would be of great added value. The way the current skeleton loader works renders it useless.

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

No branches or pull requests

2 participants