primefaces / primeng

The Most Complete Angular UI Component Library
https://primeng.org
Other
10.18k stars 4.54k forks source link

TreeSelect: Issue with TreeSelect in PrimeNG 16 - Unwanted '0' Prefix in Labels #14285

Open BouazzaSeif opened 9 months ago

BouazzaSeif commented 9 months ago

Describe the bug

Hello,

I've encountered an issue with TreeSelect in PrimeNG 16 where the labels display an undesired '0' in front of each one. This problem is illustrated in the attached screenshot.

image

Additionally, the same bug can be observed on the official PrimeNG documentation site:

image

Could you please look into this matter and provide a fix for the unwanted '0' prefix in the TreeSelect labels? It impacts the user experience, and your prompt attention to this issue would be highly appreciated.

Thank you.

Environment

"primeng": "16.9.1" "angular": "16"

Reproducer

https://stackblitz.com/edit/skfymg?file=src%2Fservice%2Fnodeservice.ts

Angular version

16

PrimeNG version

16.9.1

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

16.17.0

Browser(s)

No response

Steps to reproduce the behavior

No response

Expected behavior

No response

adcore-dev commented 9 months ago

I opened same issue few weeks ago, no feedback till now

14193

jschu commented 9 months ago

A workaround for this issue is to create a template to override the label. Unfortunatelly there is no predefined template to do this. So you have to set the property type for all your TreeNodes and define a template with the exact same name.

https://stackblitz.com/edit/skfymg-giimzn

Note: In PrimeNG 17 this problem no longer exists

adcore-dev commented 9 months ago

@jschu Hey, but this workaround stop working when you add other template to component: image

PrimeNG 17, not an option for now, it require Angular 17, which require Node 18.

jschu commented 9 months ago

this seems like a specific problem with the template itemtogglericon I could not find a solution for this specific case with other templates, the workaround works

cetincakiroglu commented 8 months ago

Hi,

This issue is already fixed and cannot be replicated with the latest version. Could you please share a stackblitz example if it still exists?

adcore-dev commented 8 months ago

Hi, In 17.x.x problem resolved In 16.x.x problem exist

Gabrielfch commented 1 month ago

Hola la forma de resolverlo en la version 16.9.1 `

{{node.label}}

` image