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

TreeTable: @node-select and @node-expand don't work together #6238

Open
fariss opened this issue Aug 15, 2024 · 0 comments
Open

TreeTable: @node-select and @node-expand don't work together #6238

fariss opened this issue Aug 15, 2024 · 0 comments
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@fariss
Copy link

fariss commented Aug 15, 2024

Describe the bug

Using TreeTable, I am implementing a feature where a node toggle event will expand the parent node, as well as the first child node and keeps the other children nodes collapsed.

This works fine when using @nodeSelect, but @nodeExpand does not behave as expected, even though they are assigned to the same event handler:

@nodeSelect="onNodeSelect"
@nodeExpand="onNodeSelect"

In this case @nodeSelect is able to change the expandedKeys to toggle the node and its first child, but @nodeExpand doesn't work (i.e. when the user clicks the > toggle icon). It seems they cannot both operate on the same expandedKeys

I think this is a bug in PrimeVue, and the following is an example which uses Toast to print out the expandedKeys.

Kapture 2024-07-28 at 03 11 39

As you can see here, the onNodeSelect is triggered when the toggle button (>) but the first child is not expanded.

Reproducer

https://stackblitz.com/edit/gdab7p

PrimeVue version

4.0.0

Vue version

3.x

Language

ALL

Build / Runtime

Vite

Browser(s)

Mozilla Firefox (latest)

Steps to reproduce the behavior

  1. Click on a node: results in parent node and its first child being expanded (e.g. {'3': true, '3-0', true'})
  2. Click the toggle node (i.e. the button >): results in parent node being expanded, but first child node is not expanded.

Expected behavior

Both @nodeExpand and @nodeSelect should behave the same, but only @nodeSelect does.

@fariss fariss added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

No branches or pull requests

1 participant