Skip to content

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

Open
@ryparker

Description

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

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions