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(CommandPalette): activate first option after async search #981

Merged

Conversation

flozdra
Copy link
Contributor

@flozdra flozdra commented Nov 16, 2023

πŸ”— Linked issue

Fixes #980

❓ 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

When using a group with async search in <CommandPalette> groups, the first item is not activated when the async search function resolves.

This PR activate the first option after async search in the <CommandPalette>, and reformat the code to use the same method activateFirstOption:

  • in the onMounted function (when using autoselect prop)
  • when the query changes (in the watch function)
  • in the debouncedSearch callback.

πŸ“ Checklist

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

Copy link

vercel bot commented Nov 16, 2023

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Updated (UTC)
ui βœ… Ready (Inspect) Visit Preview Nov 16, 2023 4:48pm

@benjamincanac benjamincanac merged commit a975939 into nuxt:dev Nov 16, 2023
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.

CommandPalette: activate first option after async search
2 participants