Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(datagrid): remove setTimeout and check visibility for calculations (
#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 <[email protected]>
- Loading branch information