Skip to content

fix: hotkeys not triggering on Brave browser when target is document or window#20

Merged
KevinVandy merged 5 commits intoTanStack:mainfrom
rvasseur31:fix-handle-event-target
Feb 18, 2026
Merged

fix: hotkeys not triggering on Brave browser when target is document or window#20
KevinVandy merged 5 commits intoTanStack:mainfrom
rvasseur31:fix-handle-event-target

Conversation

@rvasseur31
Copy link
Contributor

🎯 Changes

Hotkeys registered on document or window were not being triggered on Brave browser due to non-standard event.currentTarget behavior. Brave sets currentTarget to document.documentElement instead of document when a listener is attached to document, likely due to privacy/fingerprinting protections.

Updated #isEventForTarget to accept both document and document.documentElement as valid currentTarget values for cross-browser compatibility.

✅ 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).

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 18, 2026

Open in StackBlitz

@tanstack/hotkeys

npm i https://pkg.pr.new/TanStack/hotkeys/@tanstack/hotkeys@20

@tanstack/hotkeys-devtools

npm i https://pkg.pr.new/TanStack/hotkeys/@tanstack/hotkeys-devtools@20

@tanstack/react-hotkeys

npm i https://pkg.pr.new/TanStack/hotkeys/@tanstack/react-hotkeys@20

@tanstack/react-hotkeys-devtools

npm i https://pkg.pr.new/TanStack/hotkeys/@tanstack/react-hotkeys-devtools@20

@tanstack/solid-hotkeys

npm i https://pkg.pr.new/TanStack/hotkeys/@tanstack/solid-hotkeys@20

@tanstack/solid-hotkeys-devtools

npm i https://pkg.pr.new/TanStack/hotkeys/@tanstack/solid-hotkeys-devtools@20

commit: 7d1ebe6

@KevinVandy KevinVandy merged commit 26a74d8 into TanStack:main Feb 18, 2026
4 checks passed
@github-actions github-actions bot mentioned this pull request Feb 18, 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