Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix controlled item value #109

Merged
merged 3 commits into from
Apr 10, 2023

Conversation

joaom00
Copy link
Contributor

@joaom00 joaom00 commented Apr 9, 2023

In the code it is checked if value !== undefined to call onValueChange, so when no item is selected the value is undefined making the Command uncontrolled.

Closes #106

@vercel
Copy link

vercel bot commented Apr 9, 2023

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

Name Status Preview Comments Updated (UTC)
cmdk-website ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 10, 2023 3:17pm

@pacocoursey pacocoursey merged commit 65168c2 into pacocoursey:main Apr 10, 2023
@joaom00 joaom00 deleted the fix-controlled-command-value branch April 10, 2023 15:48
@jeloi
Copy link

jeloi commented Jun 3, 2023

@joaom00 Thank you for this fix! How can I use this version before a new release is cut / could we cut a 0.2.1 with this fix?

@joaom00
Copy link
Contributor Author

joaom00 commented Jun 3, 2023

@jeloi You can clone the project and use locally

@JiriTrecak
Copy link

This fix is really important, is 0.2.1 coming anytime soon?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

onValueChange stops working after returning undefined
4 participants