timc1 / kbar

fast, portable, and extensible cmd+k interface for your site
https://kbar.vercel.app
MIT License
4.84k stars 185 forks source link

KBarResults: Always scroll activeRef into view on mount. #209

Closed borjadotai closed 2 years ago

borjadotai commented 2 years ago

First off, great work with kbar, tried it yesterday and really loved it! 👏 I've encountered this little annoying bug where sometimes, when you close the command bar and open it again, the activeIndex is the right one and the activeRef is there, but the virtual list is scrolled down to the middle and so, you can't see the active element. I thought a good fix was to make sure that the activeRef is visible whenever you mount the command bar.

vercel[bot] commented 2 years ago

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/timc/kbar/9YJd17RQiTXFHvbrx57Vg4zhCha3
✅ Preview: https://kbar-git-fork-borjadotai-patch-1-timc.vercel.app

stale[bot] commented 2 years ago

Hey! This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.