Skip to content

Add null-safety to searchbar keyboard event handlers#36

Closed
Copilot wants to merge 1 commit intoredesignfrom
copilot/sub-pr-33
Closed

Add null-safety to searchbar keyboard event handlers#36
Copilot wants to merge 1 commit intoredesignfrom
copilot/sub-pr-33

Conversation

Copy link
Contributor

Copilot AI commented Nov 7, 2025

Keyboard shortcuts (Cmd+K to focus, Escape to blur) were calling methods on searchbar without null-checking, causing runtime errors during SSR or before DOM initialization.

Changes:

  • Added optional chaining (?.) to searchbar.focus() and searchbar.blur() calls
  • Prevents runtime errors when getElementById('searchbar') returns null
// Before
searchbar.focus();
searchbar.blur();

// After
searchbar?.focus();
searchbar?.blur();

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI mentioned this pull request Nov 7, 2025
@vercel
Copy link

vercel bot commented Nov 7, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
icons Ready Ready Preview Comment Nov 7, 2025 1:28am

Copilot AI changed the title [WIP] Address feedback on redesign from review comments Add null-safety to searchbar keyboard event handlers Nov 7, 2025
Copilot AI requested a review from jis3r November 7, 2025 01:29
@jis3r jis3r closed this Nov 7, 2025
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.

2 participants