primefaces / primeng

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

p-listbox item disabled not working since 16.7.0 #16030

Closed StefanPopa02 closed 2 weeks ago

StefanPopa02 commented 1 month ago

Describe the bug

I am trying to upgrade to latest primeng version, but i'm facing some issues. p-listbox item disabled feature is not working since 16.7.0.

Seems like this method was changed isOptionDisabled(option: any)

in 16.6: https://github.com/primefaces/primeng/blob/16.6.0/src/app/components/listbox/listbox.ts#L453 in 16.7: https://github.com/primefaces/primeng/blob/16.7.0/src/app/components/listbox/listbox.ts#L1365

In 16.6 i could have a list of options with the disabled property set to true in order to disable a particular listbox item. In the newer versions i cannot do this anymore.

stackblitz examples working example in v15 not working example in v17

Is there any workaround?

Environment

Windows 11

Reproducer

No response

Angular version

17.1.3

PrimeNG version

17.18.4

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

20.10.0

Browser(s)

No response

Steps to reproduce the behavior

No response

Expected behavior

No response

StefanPopa02 commented 1 month ago

Just figured out from the source code, you can specify the optionDisabled key. Here is a working stackblitz example

Perhaps this example should also be included on the docs page.