Skip to content

Add guard to normalizeKeyName() for undefined keys + changeset#99

Closed
Copilot wants to merge 2 commits intomainfrom
copilot/add-changeset-to-pr-98
Closed

Add guard to normalizeKeyName() for undefined keys + changeset#99
Copilot wants to merge 2 commits intomainfrom
copilot/add-changeset-to-pr-98

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 31, 2026

🎯 Changes

event.key can be undefined in rare cases (browser extensions synthesizing key events, accessibility tools, certain OS/browser combinations). normalizeKeyName() called key.toUpperCase() without guarding, causing:

TypeError: Cannot read properties of undefined (reading 'toUpperCase')
  • constants.ts: Early-return '' when key is falsy in normalizeKeyName()
  • parse.test.ts: Tests for '' and undefined (coerced) inputs
  • .changeset/guard-normalize-key-name-undefined.md: Patch changeset for @tanstack/hotkeys

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm run test:pr.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

Copilot AI changed the title [WIP] Add changeset for pull request #98 Add guard to normalizeKeyName() for undefined keys + changeset Mar 31, 2026
Copilot AI requested a review from KevinVandy March 31, 2026 16:51
@KevinVandy KevinVandy closed this Mar 31, 2026
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