huntabyte / cmdk-sv

cmdk, but for Svelte ✨
https://cmdk-sv.com
MIT License
410 stars 17 forks source link

Support meta key and home/end shortcuts #78

Open Ernxst opened 1 month ago

Ernxst commented 1 month ago

I assumed that this library would support Home and End for going to the top and bottom of the command items but it didn't work. After inspecting the code, I noticed it's supposed to but doesn't actually work because the method (/src/lib/cmdk/command.ts#409) doesn't trigger a state update.

As a result, this also fixes Meta + ArrowUp/ArrowDown to jump to the beginning or end. Since the code is already there I've assumed this was intended to be supported otherwise the updateSelectedToIndex doesn't actually do anything.

changeset-bot[bot] commented 1 month ago

🦋 Changeset detected

Latest commit: ae6030e65df226d3236ebad1d880edf14c0e1d39

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ------- | ----- | | cmdk-sv | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

vercel[bot] commented 1 month ago

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

Name Status Preview Comments Updated (UTC)
cmdk-sv ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 22, 2024 0:40am