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 · 0 comments
Open

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

ryparker opened this issue Jul 1, 2024 · 0 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

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

1 participant