diff --git a/change/@ni-nimble-components-3bbc3e1f-cc55-43d0-9f8a-96229d247ce8.json b/change/@ni-nimble-components-3bbc3e1f-cc55-43d0-9f8a-96229d247ce8.json new file mode 100644 index 0000000000..f8cddee7fc --- /dev/null +++ b/change/@ni-nimble-components-3bbc3e1f-cc55-43d0-9f8a-96229d247ce8.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Fix bug where nesting level of rows sometimes gets out of sync with data", + "packageName": "@ni/nimble-components", + "email": "20542556+mollykreis@users.noreply.github.com", + "dependentChangeType": "patch" +} diff --git a/packages/nimble-components/src/table/components/row/index.ts b/packages/nimble-components/src/table/components/row/index.ts index be4f6be7d0..ec4cb5b7c5 100644 --- a/packages/nimble-components/src/table/components/row/index.ts +++ b/packages/nimble-components/src/table/components/row/index.ts @@ -128,6 +128,11 @@ export class TableRow< return this.isParentRow && this.nestingLevel === 0; } + @volatile + public get isNestedParent(): boolean { + return this.isParentRow && this.nestingLevel > 0; + } + // Programmatically updating the selection state of a checkbox fires the 'change' event. // Therefore, selection change events that occur due to programmatically updating // the selection checkbox 'checked' value should be ingored. diff --git a/packages/nimble-components/src/table/components/row/template.ts b/packages/nimble-components/src/table/components/row/template.ts index 0d1a7e066c..6b04ae9eef 100644 --- a/packages/nimble-components/src/table/components/row/template.ts +++ b/packages/nimble-components/src/table/components/row/template.ts @@ -69,7 +69,7 @@ export const template = html` `)} ${repeat(x => x.columns, html` ${when(x => !x.columnHidden, html`