Tree: onNodeClick event replaces the inline style of the component child nodes #17171
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
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 :
before click :
after click :
Pull Request Link
No response
Reason for not contributing a PR
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
Expected behavior
The custom styles defined in the TreeNode's
style
property should persist after node selection/clickThe text was updated successfully, but these errors were encountered: