Skip to content

Conversation

ok7sai
Copy link
Member

@ok7sai ok7sai commented Sep 9, 2025

No description provided.

@ok7sai ok7sai requested a review from wagnermaciel September 9, 2025 23:10
@ok7sai ok7sai requested a review from a team as a code owner September 9, 2025 23:10
@ok7sai ok7sai requested review from tjshiu and removed request for a team September 9, 2025 23:10

if (!this.multi() && !this.followFocus()) {
return manager.on(e => this.goto(e, {toggle: true}));
return manager.on(e => this.goto(e, {selectOne: true}));
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this just be combined together? I am not sure if I understand why we change this to toggle vs selectOne? Is it because it isn't mulit?

Copy link
Member Author

@ok7sai ok7sai Sep 9, 2025

Choose a reason for hiding this comment

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

No, when it's not multi-selectable clicking on the same tree item shouldn't deselect it https://www.w3.org/WAI/ARIA/apg/patterns/treeview/examples/treeview-1a/ so it should perform selectOne instead of toggle.

The current behavior https://ng-comp-devapp.web.app/cdk-experimental-tree is incorrect.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry - I am still a noob at github - I meant lines 279 is also doing the same thing. So essentially it just would need to check if it is not multi.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh oops yes you are absolutely correct. It should be combined to

if (!this.multi()) {
  return manager.on(e => this.goto(e, {selectOne: true}));
}

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed! Thanks for catching that redundant code!

@ok7sai ok7sai added action: merge The PR is ready for merge by the caretaker target: major This PR is targeted for the next major release labels Sep 10, 2025
@ok7sai ok7sai merged commit c21dfa3 into angular:main Sep 11, 2025
26 of 28 checks passed
@ok7sai ok7sai deleted the ng-aria-tree branch September 11, 2025 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action: merge The PR is ready for merge by the caretaker target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants