primefaces / primeng

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

MultiSelect: changes in selectedItemsLabel input are not updated #15832

Open butskri opened 5 months ago

butskri commented 5 months ago

Describe the bug

The text in the selectedItemsLabel is not updated when changed dynamically (for instance when changing using translate pipe and language is changed behind the scenes) This bug is closely related to Primeng issue 14321: It is actually the same issue, only this time the issue arises when dynamically changing the selectedItemsLabel attribute instead of the placeholder attribute.

Environment

Microsoft windows 10 Pro Version 10.0.19044 Build 19044 using wsl 5.10.102.1-microsoft-standard-WSL2 running Ubuntu 20.04.6 LTS

Reproducer

No response

Angular version

17.3.8

PrimeNG version

17.8.0

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

18.20.2

Browser(s)

Chrome 125.0.6422.142

Steps to reproduce the behavior

1 Use p-multiSelect 2 Use dynamic text in selectedItemsLabel attribute (for example {{'countries.selected' | translate}})

  1. Open application in any browser
  2. Choose language english
  3. Select More then 3 items in your dropdown
  4. The following text is displayed: '3 countries selected'
  5. Choose other language (for instance dutch)
  6. The following text should be displayed now: '3 landen geselecteerd', but it remains '3 countries selected'

Expected behavior

In step 8 of the above scenario, the text should be updated to the new language when the language is changed, meaning: '3 landen geselecteerd' should be displayed instead of '3 countries selected'

butskri commented 4 months ago

Can someone please fix this issue or at least take a look at it?