Skip to content

Prevent useKeyboardShortcuts from re-registering the global keydown listener every render #897

Description

@RUKAYAT-CODER

Overview
In src/hooks/useKeyboardShortcuts.ts, commandMap (lines 175-177) depends on the commands prop; when callers pass an inline commands array the map and handler change identity every render, so the document keydown listener is removed and re-added on every render. Accept a stable commands contract or key the map on command ids so the listener is attached once.

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions