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

Remove null check from Dropdown getSelectedOptionIndex() #7371

Merged
merged 1 commit into from
Oct 24, 2024
Merged

Remove null check from Dropdown getSelectedOptionIndex() #7371

merged 1 commit into from
Oct 24, 2024

Conversation

VentuzTammoHinrichs
Copy link
Contributor

@VentuzTammoHinrichs VentuzTammoHinrichs commented Oct 24, 2024

Fix #7370

Currently setting props.value to null clears the dropdown even if an option with a null value is present.

This allows for null option values in Dropdowns again.

Functionally it's fully compatible - if the options don't contain a null value option, the function's return value will be -1 and the dropdown will be cleared as before.

There might be a small performance hit if value=null is used to clear the selection of a dropdown with lots of entries.

Currently setting props.value to null clears the dropdown even if an option with a null value is present.

This allows for null option values in Dropdowns again.

Functionally it's fully compatible - if the options don't contain a null option, the return value will be -1 and the dropdown will be cleared as before.

There might be a small performance hit if anyone has used value=null to clear the selection of a dropdown with lots of entries.
Copy link

vercel bot commented Oct 24, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
primereact ⬜️ Ignored (Inspect) Visit Preview Oct 24, 2024 1:42pm
primereact-v9 ⬜️ Ignored (Inspect) Visit Preview Oct 24, 2024 1:42pm

@melloware melloware merged commit 8056821 into primefaces:master Oct 24, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dropdown: Allow null / "" / [] / {} again as option values
2 participants