tegel icon indicating copy to clipboard operation
tegel copied to clipboard

[Bug report]: tds-table, console error on rerender

Open finnlake opened this issue 11 months ago • 0 comments

Requirements before reporting

  • [X] No duplicated issue reported.
  • [X] I have checked the latest version if the bug exist there. See all available packages at npmJS.com
  • [X] I have followed the installation guide.

Package versions

@scania/tegel-angular: "^1.6.0"

Browser

Chrome

Framework

Angular

Version

Angular 17

Reproduction steps

  1. Add component tds-table
  2. Table renders ok without error.
  3. Table rerenders the error is logged, ...

Code example

....

Screenshots

image

image

Expected behaviour

Validate that the header is found before getting the children.

componentWillRender() { const headerColumnsNo = this.host.parentElement.querySelector('tds-table-header').children.length; // multiselect and expended features requires one extra column for controls... if (this.multiselect || this.expandableRows) { this.columnsNumber = headerColumnsNo + 1; } else { this.columnsNumber = headerColumnsNo; } }

Console errors

image

Contact information

[email protected]

finnlake avatar Mar 12 '24 09:03 finnlake