Closed revogabe closed 1 year ago
Closes #115
In this PR, I added the optional prop of default value, which, when passing the item's value to the default value, makes this item active. Otherwise, the function of activating the first item on the list continues.
const [value, setValue] = React.useState('apple') return ( <Command value={value} onValueChange={setValue}> <Command.Input /> <Command.List> <Command.Item>Orange</Command.Item> <Command.Item>Apple</Command.Item> </Command.List> </Command> )
return ( <Command defaultValue="Apple"> <Command.Input /> <Command.List> <Command.Item>Orange</Command.Item> <Command.Item>Apple</Command.Item> </Command.List> </Command> )
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Done! 🥳
Closes #115
In this PR, I added the optional prop of default value, which, when passing the item's value to the default value, makes this item active. Otherwise, the function of activating the first item on the list continues.
BEFORE
NOW