Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
The current action matching behaviour of
react-hotkeys
has caused confusion and seemed to contradict user's expectations a couple of times (#161, #181, #175): It first examines<HotKeys/>
components closest to the element currently in focus, and then moves towards the top of the app, examining the full hierarchy of focused<HotKeys />
components, before moving on to<GlobalHotkeys/>
.The trouble is that submatches are allowed in this matching process: If 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+?
) the longer key combination is hidden behind the shorter one and never triggered whenever a child of the<HotKeys/>
component that defines the shorter combination is in focus.This pull request
allowCombinationSubmatches
configuration option to enable submatching and disables it by default (i.e. submatching is turned off by default)