Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tree | onKeydown is broken with contextMenu #13558

Closed
MosheSchnitzler opened this issue Aug 28, 2023 · 0 comments · Fixed by #13751
Closed

Tree | onKeydown is broken with contextMenu #13558

MosheSchnitzler opened this issue Aug 28, 2023 · 0 comments · Fixed by #13751
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@MosheSchnitzler
Copy link

Describe the bug

When binding the ContextMenu component to the Tree component by passing the ContextMenu's template variable into the Tree's contextMenu property as described in the docs, and then trying to move around the focus on the tree items with arrows up/down, I get the error Cannot read properties of undefined (reading 'nativeElement').

Here is a link to the line of code where the crash happens.

Environment

I was able to reproduce the error on PrimeNg's documentation page

Reproducer

No response

Angular version

16.2.0

PrimeNG version

16.2.0

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

18.10.0

Browser(s)

Chrome 116.0.5845.111

Steps to reproduce the behavior

  1. Simply head over to https://primeng.org/tree#contextmenu
  2. In the section where the documentation describes how to use Tree with ContextMenu, click on one of the tree items to make them focused. Make sure you click on the TreeItem, and not on the expand icon.
  3. Open the devtools > console - so you can watch for the error.
  4. Try to navigate up and down with the keyboard arrows. The error should pop up, and the focus won't move

Expected behavior

The tree item's focus should move around on the Tree component from tree item to tree item when using the up/down arrow keys.

@MosheSchnitzler MosheSchnitzler added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Aug 28, 2023
@cetincakiroglu cetincakiroglu changed the title Component: Tree Tree | onKeydown is broken Sep 27, 2023
@cetincakiroglu cetincakiroglu added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Sep 27, 2023
@cetincakiroglu cetincakiroglu added this to the 16.4.1 milestone Sep 27, 2023
@cetincakiroglu cetincakiroglu changed the title Tree | onKeydown is broken Tree | onKeydown is broken with contextMenu Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants