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

fix(datagrid): remove setTimeout and check visibility for calculations #1577

Merged
merged 2 commits into from
Oct 2, 2024

Conversation

dtsanevmw
Copy link
Contributor

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?

  • 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.

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
  • No

Other information

@dtsanevmw dtsanevmw requested a review from a team October 2, 2024 12:21
@dtsanevmw dtsanevmw self-assigned this Oct 2, 2024
projects/angular/src/data/datagrid/datagrid.ts Outdated Show resolved Hide resolved
projects/angular/src/data/datagrid/datagrid.ts Outdated Show resolved Hide resolved
@dtsanevmw dtsanevmw force-pushed the dtsanevmw/datagrid_visibility_issue branch from 80fc550 to 789d945 Compare October 2, 2024 12:32
Copy link
Member

@kevinbuhmann kevinbuhmann left a comment

Choose a reason for hiding this comment

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

LGTM, I didn't test anything though.

Copy link
Member

@kevinbuhmann kevinbuhmann left a comment

Choose a reason for hiding this comment

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

See comment.

@dtsanevmw dtsanevmw force-pushed the dtsanevmw/datagrid_visibility_issue branch from 789d945 to 787f1b6 Compare October 2, 2024 12:46
Copy link
Contributor

github-actions bot commented Oct 2, 2024

👋 @dtsanevmw,

  • 🙏 The Clarity team thanks you for opening a pull request
  • 🎉 The build for this PR has succeeded
  • 🔍 The PR is now ready for review
  • 🍿 In the meantime, view a preview of this PR
  • 🖐 You can always follow up here. If you're a VMware employee, you can also reach us on our internal Clarity Support space

Thank you,

🤖 Clarity Release Bot

@dtsanevmw dtsanevmw force-pushed the dtsanevmw/datagrid_visibility_issue branch from 787f1b6 to 45f7812 Compare October 2, 2024 12:47
Copy link
Contributor

@valentin-mladenov valentin-mladenov left a comment

Choose a reason for hiding this comment

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

Check my comments

Copy link
Contributor

github-actions bot commented Oct 2, 2024

This PR introduces visual changes: 1c6e608
If these changes are intended and correct, please cherry-pick the above commit to this PR.

git checkout dtsanevmw/datagrid_visibility_issue
git fetch https://github.com/vmware-clarity/ng-clarity.git 1c6e60883e8675812385de58bc1c28eefc4713af
git cherry-pick 1c6e60883e8675812385de58bc1c28eefc4713af
git push

@dtsanevmw dtsanevmw merged commit 086a45a into main Oct 2, 2024
8 checks passed
@dtsanevmw dtsanevmw deleted the dtsanevmw/datagrid_visibility_issue branch October 2, 2024 14:11
dtsanevmw added a commit that referenced this pull request Oct 2, 2024
Copy link
Contributor

github-actions bot commented Oct 2, 2024

🎉 This PR is included in version 17.3.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Copy link
Contributor

Hi there 👋, this is an automated message. To help Clarity keep track of discussions, we automatically lock closed PRs 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants