AfterClass-io / afterclass.io-v2

[alpha] v2 of https://afterclass.io!
https://afterclass-io.vercel.app
MIT License
4 stars 2 forks source link

fix: unintentional disabling of `Command` after upgrading cmdk to v1.x #96

Closed davidlhw closed 3 months ago

davidlhw commented 3 months ago

context

upgrading to cmdk v1.x (3684199) broke Command component, which also impacted Combobox component

the fix

comment with elaborated solution https://github.com/shadcn-ui/ui/issues/2980#issuecomment-2029267475

cmdk v1.0.0 release notes:

Command.List is now required (CommandList in shadcn)

// Before
<Command label="Command Menu">
  <Command.Input />
  <Command.Item />
  {/* ... */}
</Command>
// After
<Command label="Command Menu">
  <Command.Input />
  <Command.List>
      <Command.Item />
      {/* ... */}
  </Command.List>
</Command>

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"] {}
vercel[bot] commented 3 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
afterclass-io-v2 ✅ Ready (Inspect) Visit Preview Apr 24, 2024 8:53pm