Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

`useHotkey` callback fire during active `useHotkeySequence` matching

Aperta
#116 2 commenti 2 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
typescript
Ambito
frontend

Direzione di ricerca

Inizia riproducendo il comportamento con le registrazioni useHotkey("C") e useHotkeySequence(["G", "C"]) descritte nell’issue. Traccia come i due hook gestiscono la seconda pressione di tasto durante una sequenza attiva, quindi verifica che premere G seguito da C attivi solo il callback della sequenza, mentre un C standalone continui ad attivare il proprio callback di hotkey.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

TanStack Hotkeys version

v0.9.1

Framework/Library version

next v16.1.6

Describe the bug and the steps to reproduce it

When a single-key hotkey (e.g. C) and a sequence starting with a different key but ending with that same key (e.g. G → C) are both registered, pressing the sequence fires both the sequence callback and the single-key hotkey callback.

To Reproduce

// Register a single-key hotkey
useHotkey("C", () => {
    console.log("C hotkey fired");
});

// Register a sequence that ends with the same key
useHotkeySequence(["G", "C"], () => {
    console.log("G → C sequence fired");
});

// now press G, then press C
// notice that both log fired
Your Minimal, Reproducible Example - (Sandbox Highly Recommended)

.

Screenshots or Videos (Optional)

No response

Do you intend to try to help solve this bug with your own PR?

None

Terms & Code of Conduct
  • I agree to follow this project's Code of Conduct
  • I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
Lingua principale
TypeScript
Stelle
729
Fork
47
Merge medio
8g 8h
PR unite (30g)
4

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di TanStack/hotkeys

Tutte le issue di TanStack/hotkeys

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.