Packages

cmdk

1.1.1 · 14 Mar 2025MIT51M / weekRepositoryHomepagenpmAtom feed

Your version

1.0.0

major8 Mar 2024Where it was published

1.1.1 is the newest release of 1.x.

In short

1 breaking5 new7 fixed1 changed

  • Breaking

    This is a major version release as it contains breaking changes.

Release note

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

  • Added disablePointerSelection prop to Command to disable item selection via pointer, like Raycast

  • Fix excessive re-renders when using forceMount

  • Fixed to only scroll the selected item into view on first render and via keyboard

  • Bumped @radix-ui/react-dialog version

  • Fixed item sort not working correctly

  • Added keywords prop to the Command.Item component

  • Added asChild prop to all component parts

  • Fix suggestions list and loading progressbar labels

  • Allow keyboard navigation even when text input is not focused

  • Fix DOM error with quotes in the search query

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.