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

(Input): defaultValue does not render and throws warning #279

Open
ryparker opened this issue Jul 1, 2024 · 3 comments
Open

(Input): defaultValue does not render and throws warning #279

ryparker opened this issue Jul 1, 2024 · 3 comments

Comments

@ryparker
Copy link

ryparker commented Jul 1, 2024

Passing a defaultValue into an uncontrolled <Command.Input /> causes a console warning and the value does not appear in the input.

warning in console:

Warning: Primitive.input contains an input of type text with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props.

Reproduced demo: https://codesandbox.io/p/sandbox/cmdk-default-value-bug-qpkpwv

@ajaralampidis
Copy link

This was marked as done here #123, but it's not working at all. I am having the same error as @ryparker

@3li7u
Copy link

3li7u commented Aug 12, 2024

I have the same problem
I passed a defaultValue but it does not appear in the input search field

@3li7u
Copy link

3li7u commented Aug 12, 2024

This was marked as done here #123, but it's not working at all. I am having the same error as @ryparker

This PR talks about defaultValue of Command Component, but we talk about Command.Input

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

No branches or pull requests

3 participants