Skip to content
This repository was archived by the owner on Jun 28, 2026. It is now read-only.

fix(tree): toggle node while filtering and position of the dropdown panel#8173

Merged
melloware merged 1 commit into
primefaces:masterfrom
kaylaa0:fix/issue-8089
Jul 29, 2025
Merged

fix(tree): toggle node while filtering and position of the dropdown panel#8173
melloware merged 1 commit into
primefaces:masterfrom
kaylaa0:fix/issue-8089

Conversation

@kaylaa0

@kaylaa0 kaylaa0 commented Jul 29, 2025

Copy link
Copy Markdown
Contributor

Detect Fixes:

Issue:

  • There was a breaking change that did not fully fix the issue it was intended to resolve.
  • The main issue was that toggling was not working in a specific case when filtering in a tree.
  • Setting node.expanded wasn’t working, as it disrupted the concurrency of expanded nodes by brute forcing expanded nodes during filtering.
  • The proposed solution in the previous merge introduced new bugs and did not fully address the concurrency error.
  • One of these bugs was that the dropdown panel was not positioned correctly.

Solution:

  • Use useRef for currentFilterExpandedKeys.
  • Reset currentFilterExpandedKeys after usage.
  • Instead of using custom state, use the internal onToggle function.
  • Before any filtering starts, merge the current filter's expanded nodes and already expanded nodes to maintain concurrency.
  • Then allow any further changes to occur as normal via the onToggle function.

Result / Test Cases:

  • When filtering, corresponding nodes are expanded.
  • If nodes are already toggled, they are retained in the filtered toggle state.
  • Nodes can be freely toggled while in the filtering state.

Above cases are tested and working correctly.

Edit: Also fixes #8005

@melloware

Copy link
Copy Markdown
Member

thanks for the excellent research and fix!

@melloware melloware merged commit 9ac1c0f into primefaces:master Jul 29, 2025
4 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

2 participants