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(SelectMenu): handle Boolean type as model value #1550

Merged
merged 3 commits into from
Mar 26, 2024

Conversation

YIngChenIt
Copy link
Contributor

πŸ”— Linked issue

resolves #1544

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Add Boolean type to modelValue prop in SelectMenu.vue,Support Boolean type

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@benjamincanac benjamincanac changed the title chore(SelectMenu): Add Boolean type to modelValue prop in SelectMenu.vue fix(SelectMenu): handle Boolean type as model value Mar 25, 2024
Copy link
Member

@benjamincanac benjamincanac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might not be enough to handle booleans because of: https://github.com/nuxt/ui/pull/1550/files#diff-757d5ca664990fede027ae69097582c37e7a431404c2c6d167855665638700e0R365

This will never display the label when modelValue is false, we might need to condition on undefined / null:

} else if (props.modelValue !== undefined && props.modelValue !== null) {

@YIngChenIt
Copy link
Contributor Author

This might not be enough to handle booleans because of: https://github.com/nuxt/ui/pull/1550/files#diff-757d5ca664990fede027ae69097582c37e7a431404c2c6d167855665638700e0R365

This will never display the label when modelValue is false, we might need to condition on undefined / null:

} else if (props.modelValue !== undefined && props.modelValue !== null) {

Thanks for your suggestions. I made some adjustments and completed the corresponding usage documentation.

@benjamincanac benjamincanac merged commit c49f899 into nuxt:dev Mar 26, 2024
2 checks passed
@benjamincanac
Copy link
Member

Thanks! 😊

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.

SelectMenu error when pass false value
2 participants