timc1 / kbar

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

Respect autoFocus property on KBarSearch #354

Closed bryantebeek closed 5 months ago

bryantebeek commented 9 months ago

Hi there!

For our responsive application we are using KBar, but we are omitting the KBarPortal, KBarPositioner and KBarAnimator. In the end we are mainly using KBarProvider with KBarSearch and KBarResults. Works wonders, but the only thing is that we do not want to auto focus the search input on mobile. Passing it to KBarSearch does not work as it's hardcoded to auto focus the input, not respecting the autoFocus property as passed through the props.

This PR deconstructs the autoFocus property and sets it to true by default, so we do not change existing behaviour (only when autoFocus: false is set).

CleanShot 2024-02-08 at 21 56 03@2x

vercel[bot] commented 9 months ago

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

Name Status Preview Comments Updated (UTC)
kbar ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 8, 2024 9:01pm
stale[bot] commented 5 months 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.