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: onNodeClick event replaces the inline style of the component child nodes #17171

Open
1 of 4 tasks
aimanicose opened this issue Dec 21, 2024 · 0 comments
Open
1 of 4 tasks
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@aimanicose
Copy link

aimanicose commented Dec 21, 2024

Describe the bug

When using PrimeNG Tree component, custom styles provided in the TreeNode's style property are being overridden when the node is clicked/selected.

This is due to an override of the li tag on nodeClick event :

image

before click :

image

after click :

image

Pull Request Link

No response

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://stackblitz.com/edit/stackblitz-starters-6kwlw3uc?file=src%2Fmain.ts

Environment

Production

Angular version

19.0.1

PrimeNG version

v19

Node version

No response

Browser(s)

No response

Steps to reproduce the behavior

  1. Create a TreeNode array with custom inline style for nodes style: { 'border': '1px solid red' }
  2. Pass the array to p-tree component
  3. p-tree must be selectionMode="single"
  4. Click on a node

Expected behavior

The custom styles defined in the TreeNode's style property should persist after node selection/click

@aimanicose aimanicose added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Dec 21, 2024
aimanicose added a commit to aimanicose/primeng that referenced this issue Dec 22, 2024
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

1 participant