Skip to content

Conversation

@pharret31
Copy link
Contributor

No description provided.

@pharret31 pharret31 added the 26_1 label Feb 5, 2026
@pharret31 pharret31 force-pushed the 26_1_3249-treeview-provide-a-way-to-control-ability-to-select-nodes-qw-implementation-and-styles branch 2 times, most recently from eb1002c to 768a583 Compare February 6, 2026 13:02
@pharret31 pharret31 force-pushed the 26_1_3249-treeview-provide-a-way-to-control-ability-to-select-nodes-qw-implementation-and-styles branch 2 times, most recently from 666d3c5 to 02df753 Compare February 9, 2026 15:40
@pharret31 pharret31 marked this pull request as ready for review February 11, 2026 07:08
@pharret31 pharret31 requested a review from a team as a code owner February 11, 2026 07:08
Copilot AI review requested due to automatic review settings February 11, 2026 07:08
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new TreeView option to control whether disabled nodes participate in checkbox selection logic, and introduces test coverage for the new selection behavior.

Changes:

  • Added disabledNodeSelectionMode option to TreeView base and wired it into the hierarchical data adapter.
  • Updated selection propagation and “select all” state calculation to optionally skip disabled nodes.
  • Added QUnit coverage for initial state, selectAll/unselectAll, runtime option changes, and recursive selection scenarios.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

File Description
packages/devextreme/testing/tests/DevExpress.ui.widgets/treeView.checkboxes.tests.js Adds tests validating selection/aria-checked behavior for the new mode.
packages/devextreme/js/__internal/ui/tree_view/tree_view.base.ts Adds the new option, default value, option change handling, and passes it to the data adapter.
packages/devextreme/js/__internal/ui/hierarchical_collection/data_converter.ts Tracks disabled items count to support “select all” state computation.
packages/devextreme/js/__internal/ui/hierarchical_collection/data_adapter.ts Implements skip-disabled selection logic in recursive selection and selectAll/isAllSelected.

@pharret31 pharret31 force-pushed the 26_1_3249-treeview-provide-a-way-to-control-ability-to-select-nodes-qw-implementation-and-styles branch from 3f646fa to 3f2314a Compare February 11, 2026 09:17
Copilot AI review requested due to automatic review settings February 11, 2026 12:24
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

@pharret31 pharret31 requested a review from Copilot February 11, 2026 13:31
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings February 11, 2026 15:03
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Comment on lines +251 to +254
if (this.options.disabledNodeSelectionMode === 'never' && this._isNodeDisabled(node)) {
return;
}

Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an inconsistency between selectAll() behavior and recursive selectItem() behavior when disabledNodeSelectionMode='never'.

When selectAll() is called, it iterates through all nodes (line 570) and selects all enabled nodes, including children of disabled nodes (as shown in test at line 594 in treeView.checkboxes.tests.js).

However, when selectItem(parentKey) is called with recursiveSelection=true, the _iterateChildren method has an early return (lines 251-253) that prevents iterating into children of disabled nodes. This means children of disabled nodes won't be selected when selecting their grandparent.

This inconsistency is demonstrated in the tests:

  • Test at line 594: selectAll() with mode='never' DOES select children of disabled nodes
  • Test at line 633: selectItem(parentId) with mode='never' does NOT select children of disabled nodes

Consider removing the early return at lines 251-253 to make the behavior consistent, or add clear documentation explaining why these two operations behave differently.

Suggested change
if (this.options.disabledNodeSelectionMode === 'never' && this._isNodeDisabled(node)) {
return;
}

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants