huntabyte / cmdk-sv

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

fix: dont use onMount inside CommandInput action for autofocus #25

Closed Not-Jayden closed 8 months ago

Not-Jayden commented 8 months ago

The onMount used inside the CommandInput action is resulting in unreliable behaviour with the input autofocus behaviour actually firing.

It's also unnecessary/unintended to be used inside of an action as far as I know, as the element mount/unmount should be enough.

EDIT: FYI you can observe the broken autofocus behaviour from the docs, when navigating between the different command menus: https://www.cmdk-sv.com/

Only the first menu receives autofocus when loading the page.

changeset-bot[bot] commented 8 months ago

🦋 Changeset detected

Latest commit: fc4363407baaf1285343e4b439169135b451b3fe

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 8 months 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 Nov 18, 2023 0:49am