Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Datagrid close detail issues error for nested datagrids: row.cells.get(...) is undefined #1485

Closed
ghost opened this issue Jul 18, 2024 · 1 comment · Fixed by #1489
Closed
Assignees

Comments

@ghost
Copy link

ghost commented Jul 18, 2024

Describe the bug

If the detail pane of a datagrid contains another datagrid with less columns than the outer datagrid, closing the detail pane results in the error: row.cells.get(...) is undefined.

In particular the error is thrown at the location projects/angular/src/data/datagrid/render/main-renderer.ts:249 (accessed at: c791ff0) since the rows query list contains not only the rows of the outer datagrid but also the rows of the inner one. As the inner grid does not have as many columns as the outer one, the failing index is out of bounds.

The @ContentChildren(DatagridRowRenderer, { descendants: true }) content selector selects all rows, not only the rows which belong to the current (outer) datagrid.

Presumably this issue was introduced with #1346 (ac0d4cf)

How to reproduce

See StackBlitz Example

Steps to reproduce the behavior:

  1. Open the datagrid's detail pane of any row.
  2. Close the row detail again.
  3. See the error in the console.

Expected behavior

The datagrid should not throw an error for nested datagrids on closing the row detail.

Versions

Clarity version:

  • >= 17.2.x

Framework version:
Angular 17

Device:

  • Type: MacBook
  • OS: iOS
  • Browser: chrome, firefox
  • Version: Firefox 128.0
@kevinbuhmann kevinbuhmann self-assigned this Jul 19, 2024
kevinbuhmann added a commit that referenced this issue Jul 24, 2024
…1489)

This change prevents propagation of cell rendering changes to rows owned
by nested datagrids.

CDE-2199
closes #1485
Copy link
Contributor

github-actions bot commented Aug 8, 2024

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 Aug 8, 2024
github-actions bot pushed a commit that referenced this issue Nov 18, 2024
…1489)

This change prevents propagation of cell rendering changes to rows owned
by nested datagrids.

CDE-2199
closes #1485

(cherry picked from commit 6c4b36e)
dtsanevmw pushed a commit that referenced this issue Nov 18, 2024
…ackport to 16.x) (#1619)

Backport 6c4b36e from #1489. <br> This
change prevents propagation of cell rendering changes to rows owned by
nested datagrids.

CDE-2199
closes #1485

## PR Checklist

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

## PR Type

Bugfix

## What is the current behavior?

If the detail pane of a datagrid contains another datagrid with less
columns than the outer datagrid, closing the detail pane results in the
error: `row.cells.get(...) is undefined`.

Issue Number: #1485, CDE-2199

## What is the new behavior?

No error is thrown, and the correct cells are hidden.

## Does this PR introduce a breaking change?

No.

Co-authored-by: Kevin Buhmann <kbuhmann@vmware.com>
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant