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

fix(Select): replace logical OR Operator to Nullish Coalescing Operator #6484

Merged
merged 1 commit into from
Sep 27, 2024

Conversation

C17AN
Copy link

@C17AN C17AN commented Sep 27, 2024

###Defect Fixes

Summary

  • It seems the original intent was to display "empty" when the label does not exist, but due to the behavior of the OR operator, the label is considered falsy when it is the number 0, causing "empty" to be displayed.

  • Modify the code to use the Nullish Coalescing Operator instead, so that "empty" is only shown when the label is undefined or null.

Test

  • AS-IS
image
  • TO-BE
image

Copy link

vercel bot commented Sep 27, 2024

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

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
primevue ⬜️ Ignored (Inspect) Visit Preview Sep 27, 2024 4:20am
primevue-v3 ⬜️ Ignored (Inspect) Visit Preview Sep 27, 2024 4:20am

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.

Select: Selecting 0 option shows empty in select
2 participants