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

Datagrid rendering issue #1569

Closed
3 tasks done
vzdendyak opened this issue Sep 27, 2024 · 1 comment
Closed
3 tasks done

Datagrid rendering issue #1569

vzdendyak opened this issue Sep 27, 2024 · 1 comment
Assignees

Comments

@vzdendyak
Copy link

This is a bug report for the @clr Angular or UI versions of the design system.
For the web-component implementation of Clarity (@cds), visit vmware-clarity/core.

If you are a VMware employee or a contractor in VMware, please use our support space in Google Chat to raise Clarity issues.

Describe the bug

I'm encountering some performance issues with the datagrid component. Specifically, I've noticed the following problems:

  • Column Width Jumps: During the rendering process, the column widths appear to "jump" or adjust noticeably.
Screen.Recording.2024-09-27.at.14.35.52.mov
image

How to reproduce

Here is the stackblitz link.

I generate data dynamically and use the setTimeout to imitate the data loading process. The issue happens when the data is loaded and initially displayed in the Datagrid. It's visible that the column width is incorrect and it takes some time to recalculate the column width and display the grid correctly.

Steps to reproduce the behavior:

  1. Open the example
  2. Look at the datagrid column width change

Sometimes it renders fast, so please try to refresh the page several times.

Expected behavior

The datagrid data initial render should be smooth as it was in the previous versions.

Versions

Clarity version:

  • v17.3.0

Framework version:

  • Angular 17
  • Angular 18

Device:

  • Type: [Laptop]
  • OS: [MacOS, Windows]
  • Browser [Chrome, Opera, Firefox] (IMPORTANT: I can't reproduce this on Safari)

Additional notes

This issues affects our application seriously and stops us from migration to Angular 18 and Clarity 17.3.0

@dtsanevmw dtsanevmw self-assigned this Sep 30, 2024
dtsanevmw added a commit that referenced this issue Oct 2, 2024
#1577)

## PR Checklist

Please check if your PR fulfills the following requirements:

- [ ] Tests for the changes have been added (for bug fixes / features)
- [ ] Docs have been added / updated (for bug fixes / features)
- [ ] If applicable, have a visual design approval

## PR Type

What kind of change does this PR introduce?

<!-- Please check the one that applies to this PR using "x". -->

- [X] Bugfix
- [ ] Feature
- [ ] Code style update (formatting, local variables)
- [ ] Refactoring (no functional changes, no api changes)
- [ ] Build related changes
- [ ] CI related changes
- [ ] Documentation content changes
- [ ] Other... Please describe:

## What is the current behavior?

There was added `setTimeout`
#1494 in the renderer
to fix an issue with datagrid being in accordion but that creates
different issue - #1569. The main root cause of the wrong widths inside
the accordion come from that the content of accordion is using separate
component with `ng-content` and that is projected inside
`accordion-panel` wrapped in *ngIf which seems okey but Angular life
cycles go trough that content component before the condition on the ngIf
is met so the calculations are being done wrongly on invisible datagrid.
In header-renderer scrollWidth is 0 due to that the component is not
actually visible after it's visible "shouldStabilizeColumns" is already
false and no more re-calculations are being done.

<!-- Please describe the current behavior that you are modifying, or
link to a relevant issue. -->

Issue Number: #1569

## What is the new behavior?

Do the calculations when the datagrid is actually visible in the DOM.

## Does this PR introduce a breaking change?

- [ ] Yes
- [X] No

<!-- If this PR contains a breaking change, please describe the impact
and migration path for existing applications below. -->

## Other information

---------

Co-authored-by: GitHub <noreply@github.com>
Copy link
Contributor

Hi there 👋, this is an automated message. To help Clarity keep track of discussions, we automatically lock closed issues after 14 days. Please look for another open issue or open a new issue with updated details and reference this one as necessary.

@github-actions github-actions bot locked and limited conversation to collaborators Oct 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants