Open LinkTheFirstFlame opened 8 months ago
Same problem for us, strict mode is too strict and cannot be used because it does not show nodes inside the folder which match the search, which is a classical request for users.
Hello. Could we have information about why the lenient mode is stopping the search of matching nodes at first element found? As said in previous comment, when a user wants to do a search, it's normal to visually show him all the results corresponding to his search, and if a folder is matching, it's understandable to show to the user these children. It seems to just be a normal user's expected goal..
Currently, lenient mode cannot make this goal possible because filteredNodes contains only the first results found.. We could just realize a second filter ourself, which doesn't seem like a good idea.
We're thinking to provide you a PR to let lenient mode searches into the entire tree, we would just appreciate an approvement for this idea.
Thanks in advance and have a nice day.
Describe the bug
In lenient mode, the tree search result will not expand a folder that matches the search if it's child also matches the search too, whereas in strict mode it will show it. This problem could come from this line : https://github.com/primefaces/primeng/blob/eed5029014fc329901892a5014d66e8792d28d35/src/app/components/tree/tree.ts#L1625
Environment
Angular 17 application
Reproducer
No response
Angular version
17.2.2
PrimeNG version
17.12.0
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
10.1.0
Browser(s)
Chrome 123
Steps to reproduce the behavior
Expected behavior
In lenient mode, all result matching the search have to be visible.