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 bug with indentation of nested parent rows #1839

Merged
merged 3 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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"
}
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const template = html<TableRow>`
`)}

<span ${ref('cellContainer')}
class="cell-container ${x => (x.isParentRow && x.nestingLevel > 0 ? 'nested-parent' : '')}"
class="cell-container ${x => (x.isNestedParent ? 'nested-parent' : '')}"
rajsite marked this conversation as resolved.
Show resolved Hide resolved
>
${repeat(x => x.columns, html<TableColumn, TableRow>`
${when(x => !x.columnHidden, html<TableColumn, TableRow>`
Expand Down
Loading