react-hotkeys v2.0.0-pre7 Release Notes
Release Date: 2019-06-02 // almost 5 years ago-
Potentially breaking changes
0๏ธโฃ
react-hotkeys
now ignores key combination submatches #186 by default.This resolves the issue of when an application has a context-dependent action, bound to a short key combination (e.g.
?
) and a longer global action bound to a longer key combination (e.g.shift+?
), and the longer key combination is hidden behind the shorter one and never triggered whenever a child of the component that defines the shorter combination is in focus (#161, #181, #175).๐ง If you would like the old behaviour, you can re-enable submatches with the
allowCombinationSubmatches
configuration option:configure({ allowCombinationSubmatches: true, })
๐ For a full description of what this change means, and the tradeoffs, see the How combinations and sequences are matched section of the Readme.
๐ Bugfixes
- ๐ Fix bug that prevented binding to keydown and key for the same key combination #166
๐ New features
HotKeys root prop
A new
root
prop is now available forHotKeys
that allows placingHotKeys
components at the root of the app without actually defining any key maps or handlers, to ensure all key events are recorded (#188):<HotKeys root> //... application </HotKeys>
๐ For details of when you may want to use this, see the React Hotkeys thinks I'm holding down a key I've released section of the readme.
GlobalHotKeys report missed keyboard events
GlobalHotKeys
components now report key events that may have been missed byHotKeys
, to avoid hanging key combinations when an action handler changes focus outside of the part of the React app below the highestHotKeys
component.๐ Again, you can see the React Hotkeys thinks I'm holding down a key I've released section of the readme for more details.