Accessibility: Support disabling global character keyboard shortcuts
There are no commits yet
Push commits to the source branch or add previously merged commits to review them.
Created by: umpox
As part of WCAG 2.1, we need to provide a mechanism to remap or turn off character key shortcuts.
This PR:
useKeyboardShortcut
hook so we no longer:
keyboardShortcuts
down as props in lots of placesNote I noticed a few areas where we can improve our keyboard shortcuts, this is not relevant to this PR, but should be done for future work: (These are captured in this issue: https://github.com/sourcegraph/sourcegraph/issues/39218)
- We currently rely on a single set of keyboard shortcuts everywhere. This might burn us in the future (e.g. if we use a conflicting shortcut). We could modify our existing approach to pass a set of shortcuts into our
ShortcutContext
, this would let us vary them depending on the environment.- We currently rely on an NPM package
@slimsag/react-shortcuts
that doesn't appear to have a public repository. We should bring this in-house, as it is already a fork of a Shopify package.- We have a series of shortcuts that do not use this method for keyboard shortcuts. We should update these.
Tested locally:
Check out the client app preview documentation to learn more.
Push commits to the source branch or add previously merged commits to review them.