-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
bug(CdkTree): Clicking on nested tree nodes collapses parent tree node #29830
Labels
area: material/tree
docs
This issue is related to documentation
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Comments
cfinlinson-incomm
added
the
needs triage
This issue needs to be triaged by the team
label
Oct 4, 2024
crisbeto
added
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
area: material/tree
and removed
needs triage
This issue needs to be triaged by the team
labels
Oct 9, 2024
crisbeto
added a commit
to crisbeto/material2
that referenced
this issue
Oct 14, 2024
Fixes the following issues with the tree live examples: * Both the tree node and the toggle were marked as toggles which meant that clicking anywhere would close the tree. * The toggles weren't centered relative to the text. * A couple of examples had the same name and one had weird punctuation. Fixes angular#29830.
crisbeto
added a commit
to crisbeto/material2
that referenced
this issue
Oct 14, 2024
Fixes the following issues with the tree live examples: * Both the tree node and the toggle were marked as toggles which meant that clicking anywhere would close the tree. * The toggles weren't centered relative to the text. * A couple of examples had the same name and one had weird punctuation. Fixes angular#29830.
Looks like this was a docs issue. You can see how I've fixed it in #29875, if you want to fix it in your app. |
crisbeto
added a commit
that referenced
this issue
Oct 14, 2024
Fixes the following issues with the tree live examples: * Both the tree node and the toggle were marked as toggles which meant that clicking anywhere would close the tree. * The toggles weren't centered relative to the text. * A couple of examples had the same name and one had weird punctuation. Fixes #29830. (cherry picked from commit 52cad9c)
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
area: material/tree
docs
This issue is related to documentation
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Is this a regression?
The previous version in which this bug was not present was
Angular CDK 17
Description
When using
cdk-nested-tree-node
, if I click on a child/leaf node, it collapses the parent tree node.This does not occur when using
cdk-tree-node
; presumably, DOM click events are bubbling up and unexpectedly being handled by parent nodes. This was not happening on Angular CDK 17.Reproduction
StackBlitz link: Angular components docs: https://material.angular.io/cdk/tree/examples#cdk-tree-nested-level-accessor
Steps to reproduce:
Expected Behavior
I would expect the nodes to be expanded or collapsed only when I click an element with the
cdkTreeNodeToggle
directive. But it seems to expand/collapse whenever I click anywhere in the sub-DOM of thecdk-nested-tree-node
, including child nodes.Actual Behavior
Clicking on child nodes collapses the parent node. Also, clicking on a part of the node that is not the
cdkTreeNodeToggle
collapses the node.Environment
The text was updated successfully, but these errors were encountered: