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: Missing data-id attribute on treeitem #14541

Closed
adyeardley opened this issue Jan 12, 2024 · 4 comments
Closed

Tree: Missing data-id attribute on treeitem #14541

adyeardley opened this issue Jan 12, 2024 · 4 comments
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@adyeardley
Copy link

adyeardley commented Jan 12, 2024

Describe the bug

We recently updated our application to the latest version of PrimeNG, but some of our automated tests began to fail as it couldn't find some elements within the Tree component anymore.

We found that the automated tests are looking for the data-id attribute on each node, which was populated previously with the content of the key attribute on the TreeNode.

Did some digging in the commit history and found that on this commit, the attributes and event were moved from a div to a li, but the data-id attribute did not carry across:

12d79f7

image

Environment

Angular 17 Web App

Reproducer

No response

Angular version

17.0.6

PrimeNG version

17.3.2

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

20.10.0

Browser(s)

All Browsers

Steps to reproduce the behavior

Open a tree component with nodes inside
Inspect Element of any of the nodes
data-id is not populated with the 'key' of the node

Expected behavior

data-id should be present and populated with the content of the 'key' of the node

@adyeardley adyeardley added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jan 12, 2024
@adyeardley
Copy link
Author

Raised PR #14552 to resolve this

@mertsincan
Copy link
Member

Hi @adyeardley,

Thanks a lot for your PR! But, we plan to fix such problems with the new passthrough API. We are currently working on it and will give an update on it soon. Please see our PrimeVue passthrough API; https://primevue.org/tree/#pt.image

For now, closed. Thanks a lot for your understanding!
Best Regards,

@adyeardley
Copy link
Author

HI @mertsincan,

Thanks for the reply.

Sorry, I'm a little confused about the response, we don't use Vue.js within our application, we use the Angular framework, having the fix in the PrimeVue API will not resolve this problem for us?

@luke6040
Copy link

Good Morning @mertsincan

I have just been through this and have come to the same conclusion as @adyeardley, are we missing something? Or is @adyeardley correct and fixing PrimeVue will not help this issue? These IDs are actually pretty important for our implementation of automation testing.

Thank you for your help.
Luke

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

No branches or pull requests

3 participants