Skip to content

Issue Title #19292

@AdamJStacey

Description

@AdamJStacey

Describe the bug

Issue 1) When using arrow keys to navigate a tree with droppableNodes = true it throws an error and does not work

Image

Reproducible at https://primeng.org/tree#dragdrop

this was caused by 224b85c as the focus node is expecting 2 children on the element, but the first one got removed in this pr, and so has been an issue since v20.2.0 and still exists in the most recent version

Issue 2) When collapsing a node the focus can get thrown outside of the entire tree which I can consistently reproduce at https://primeng.org/tree#selection

Pull Request Link

#19291

Reason for not contributing a PR

  • Lack of time
  • Unsure how to implement the fix/feature
  • Difficulty understanding the codebase
  • Other

Other Reason

No response

Reproducer

https://primeng.org/tree#dragdrop

Environment

Any

Angular version

v20+

PrimeNG version

v21

Node version

22.14.0

Browser(s)

No response

Steps to reproduce the behavior

For issue one

  1. click any node in a droppableNodes Tree such as on https://primeng.org/tree#dragdrop
  2. click any arrow key
  3. check the dev console for the error

For issue 2
I can consistently reproduce this at https://primeng.org/tree#selection

  1. click to expand Movies
  2. click to expand Al Pacino
  3. press the left arrow key to collapse the node
  4. press up or down and see the cursor blinking outside of the tree

Expected behavior

using arrow keys should navigate the tree and not throw any error

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: AccessibilityIssue or pull request is related to WCAG or ARIALTS-PORTABLEIssue's fix will be ported to supported LTS versionsType: BugIssue contains a bug related to a specific component. Something about the component is not working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions