Skip to content

Conversation

J-Michalek
Copy link
Contributor

πŸ”— Linked issue

❓ 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

I found it very useful to be able to compare objects by a certain key or by custom logic as comparison by reference is not always easily achievable.

πŸ“ Checklist

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

@github-actions github-actions bot added the v4 #4488 label Oct 6, 2025
Copy link

pkg-pr-new bot commented Oct 6, 2025

npm i https://pkg.pr.new/@nuxt/ui@5158

commit: f013877

@benjamincanac
Copy link
Member

@J-Michalek This prop should also be implemented in Select, SelectMenu and InputMenu no? πŸ€”

@J-Michalek
Copy link
Contributor Author

@benjamincanac Hmm there may be more to this than I initially though. The Select, SelectMenu and InputMenu components already have valueKey prop which helps with the matching of objects by certain key, we can add the by prop to them as another option for object matching.

We could also add the valueKey to the CommandPalette for the sake of consistency, what do you think?

@benjamincanac
Copy link
Member

Indeed, adding a value-key would be better for consistency!

@benjamincanac benjamincanac marked this pull request as draft October 6, 2025 17:34
@J-Michalek J-Michalek changed the title feat(CommandPalette): add by prop for object matching feat(CommandPalette/InputMenu/Select/SelectMenu): unite object matching options Oct 7, 2025
@J-Michalek
Copy link
Contributor Author

@benjamincanac I've added the by prop to Select, SelectMenu and InputMenu. I also added the valueKey prop to CommandPalette, but I got stuck on a TS issue where it seems that the modelValue/defaultValue somehow conflicts with groups[number]['items'] type, but I could not figure out what is going on. When I tried to manually input the types into CommandPaletteProps the type looked correct, perhaps I am missing something regarding the generic types in a SFC?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v4 #4488

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants