Add keyboard shortcut for global search (#2118)

Enable users to jump to the global search bar by pressing the "/" key from anywhere. Open modals block this shortcut. This PR also introduces a generic system for declaring global shortcuts by utilizing the third-party library mousetrap.
This commit is contained in:
Konstantin Schaper
2022-09-15 14:16:22 +02:00
committed by GitHub
parent 1e72eb52bd
commit af9aaec095
21 changed files with 483 additions and 21 deletions

View File

@@ -36,6 +36,10 @@ import ChangesetShortLink from "./repos/components/changesets/ChangesetShortLink
import "./tokenExpired";
import { ApiProvider } from "@scm-manager/ui-api";
// Used by useShortcut
import "mousetrap";
// Used by usePauseShortcuts
import "mousetrap/plugins/pause/mousetrap-pause.min";
binder.bind<extensionPoints.ChangesetDescriptionTokens>("changeset.description.tokens", ChangesetShortLink);