v1.0.0
This is a major version release as it contains breaking changes.
Breaking Changes
You will need to update your code to account for these changes before upgrading to cmdk@1.0.0
.
value
is now case sensitive 3dae25d
The value
prop you pass to Command.Item
and receive in onSelect
is now case sensitive. But while the value is no longer lowercased, it is still trimmed.
Command.List
is now required (CommandList
in shadcn) 54aa261
Rendering the Command.List
part (CommandList
if using shadcn) is now mandatory. Otherwise, you should expect to see an error like this:
TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))
The fix:
// Before
<Command label="Command Menu">
<Command.Input />
<Command.Item />
{/* ... */}
</Command>
// After
<Command label="Command Menu">
<Command.Input />
<Command.List>
<Command.Item />
{/* ... */}
</Command.List>
</Command>
Update [aria-disabled]
and [aria-selected]
CSS selectors c57e6b7
The aria-disabled
and aria-selected
props will now be set to false
, instead of being undefined
. If you previously used CSS selectors based on attribute presence, you will now need to use the attribute value.
/* Before */
[aria-disabled] {}
:not([aria-disabled]) {}
/* After */
[aria-disabled="true"] {}
[aria-disabled="false"] {}
What's Changed
- Added support for rendering
Command.List
in a portal in 54aa261 - Fixed
Command.Empty
not appearing on first render in be4388e - Fixed ESM support via new exports field by @SoYoung210 in #141
- Added
disablePointerSelection
prop toCommand
to disable item selection via pointer, like Raycast by @joaom00 in #116 - Fix excessive re-renders when using
forceMount
by @joaom00 in #143 - Fixed to only scroll the selected item into view on first render and via keyboard by @joaom00 in #135
- Bumped
@radix-ui/react-dialog
version by @wmcheung in #194 - Fixed item sort not working correctly by @pengx17 in #182
- Added
keywords
prop to theCommand.Item
component by @itaikeren in #158 - Added
asChild
prop to all component parts by @joaom00 in #138 - Fix suggestions list and loading progressbar labels by @afercia in #204
- Allow keyboard navigation even when text input is not focused by @glocore in #61
- Fix DOM error with quotes in the search query by @yjl9903 in #223
New Contributors
- @SoYoung210 made their first contribution in #141
- @wmcheung made their first contribution in #194
- @pengx17 made their first contribution in #182
- @itaikeren made their first contribution in #158
- @afercia made their first contribution in #204
- @glocore made their first contribution in #61
- @yjl9903 made their first contribution in #223
Full Changelog: v0.2.1...v1.0.0