Skip to content

Search bar quality of life improvements#154

Open
avik-ch wants to merge 3 commits into
samyok:mainfrom
avik-ch:feat/searchbox-focus
Open

Search bar quality of life improvements#154
avik-ch wants to merge 3 commits into
samyok:mainfrom
avik-ch:feat/searchbox-focus

Conversation

@avik-ch

@avik-ch avik-ch commented May 24, 2026

Copy link
Copy Markdown

Not an open issue but I thought the search bar could benefit from a few UX tweaks:

  • Autofocus on page load
  • Quick shortcut to jump to search box when needed

Autofocus

Added functionality so that the search box is focused on page load so that users can start searching without having to make an additional click. This feels normal for a website that is based around search. The default html autofocus attribute does not work, probably due to some timing issue with react, next js and how it gets loaded to DOM. That is why the complicated useRef workaround was used. Happy to consider feedback on how to improve this.

Initially I made it autofocus on every page load; however, it looked odd on pages other than the home page with its halo around the borders when focused. So, the autofocus prop was added to only focus the search bar on the home page. If needed, we can change this to happen on all pages.

The / jump shortcut

Added a quick way to jump to the search box by pressing /. This is expected behavior on most search based sites. Also added a quick toast like google to signal the existence of this feature to someone typing without focusing on the search box.

@vercel

vercel Bot commented May 24, 2026

Copy link
Copy Markdown

@avik-ch is attempting to deploy a commit to the umn social coding Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant