Skip to content

fix: the event key may be undefined#1068

Merged
43081j merged 1 commit intonpmx-dev:mainfrom
btea:fix/event-key-maybe-undefined
Feb 6, 2026
Merged

fix: the event key may be undefined#1068
43081j merged 1 commit intonpmx-dev:mainfrom
btea:fix/event-key-maybe-undefined

Conversation

@btea
Copy link
Copy Markdown
Contributor

@btea btea commented Feb 6, 2026

npmx

@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 6, 2026

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

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Feb 6, 2026 3:53am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Feb 6, 2026 3:53am
npmx-lunaria Ignored Ignored Feb 6, 2026 3:53am

Request Review

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 6, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
app/utils/input.ts 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 6, 2026

📝 Walkthrough

Walkthrough

This change modifies the isKeyWithoutModifiers function in app/utils/input.ts by adding optional chaining to the event.key property access. The modification changes event.key.toLowerCase() to event.key?.toLowerCase(), which handles the case where event.key might be undefined. All other keyboard modifier checks remain unchanged. The function signature and public API remain intact.

🚥 Pre-merge checks | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description contains only an image reference with no textual explanation of the changes, making it impossible to assess its relevance to the code modifications. The author should provide a clear textual description explaining the fix for the undefined event key issue, rather than relying solely on an image reference.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@43081j 43081j left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good.

chrome sets the key to undefined on autocomplete, basically. which is non-standard (i.e. key in the spec is always defined)

@43081j 43081j changed the title fix(utils): the event key may be undefined fix: the event key may be undefined Feb 6, 2026
@43081j 43081j added this pull request to the merge queue Feb 6, 2026
Merged via the queue into npmx-dev:main with commit f7d9920 Feb 6, 2026
15 of 17 checks passed
@btea btea deleted the fix/event-key-maybe-undefined branch February 6, 2026 23:47
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