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

p-listbox item disabled not working since 16.7.0 #16030

Closed
StefanPopa02 opened this issue Jul 15, 2024 · 1 comment
Closed

p-listbox item disabled not working since 16.7.0 #16030

StefanPopa02 opened this issue Jul 15, 2024 · 1 comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@StefanPopa02
Copy link

StefanPopa02 commented Jul 15, 2024

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 StefanPopa02 added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jul 15, 2024
@StefanPopa02 StefanPopa02 changed the title p-listbox item disabled not working sincer 16.7.0 p-listbox item disabled not working since 16.7.0 Jul 15, 2024
@StefanPopa02
Copy link
Author

StefanPopa02 commented Jul 15, 2024

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.

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