Up/Down keys are not secured against no children #6705
Labels
Type: Bug
Issue contains a bug related to a specific component. Something about the component is not working
Milestone
I'm submitting a ... (check one with "x")
Plunkr Case (Bug Reports)
Please demonstrate your case at stackblitz by using the issue template below. Issues without a test case have much less possibility to be reviewd in detail and assisted.
https://stackblitz.com/github/primefaces/primeng-issue-template
Current behavior
Expected behavior
The problem is when you expand a node with no children.
In this case down/up keys try to access to children and you get an error in console
Minimal reproduction of the problem with instructions
Create a tree with an expandable node that has no children.
Expand that node, now try to move up or down, you will get an error in console
The fix is protect the code.
In onKeyDown function:
In findLastVisibleDescendant function:
The text was updated successfully, but these errors were encountered: