Skip to content

Conversation

@kaylaa0
Copy link
Contributor

@kaylaa0 kaylaa0 commented Jul 29, 2025

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
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 join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants