Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotkeys v2 with hooks #4532

Merged
merged 10 commits into from Feb 18, 2021
Merged

Hotkeys v2 with hooks #4532

merged 10 commits into from Feb 18, 2021

Conversation

adidahiya
Copy link
Contributor

@adidahiya adidahiya commented Feb 18, 2021

Fixes #3508, fixes #3604, fixes #3431, #2972, fixes #1590, fixes #3228, fixes #1028

Checklist

  • Includes tests
  • Update documentation

Changes proposed in this pull request:

  • New hook useHotkeys
  • New components <HotkeysProvider> and <HotkeysTarget2>
  • Deprecated @HotkeysTarget

Reviewers should focus on:

Check out the new docs

Other notes

It is possible to programmatically show the hotkeys dialog but this is not documented:

import { HotkeysContext } from "@blueprintjs/core";
import { useContext, useEffect } from "react";

function MyComponent() {
  const [, dispatch] = useContext(HotkeysContext);
  useEffect(() => {
    dispatch({ type: "OPEN_DIALOG" });
  }, []);

  return <div />;
}

@adidahiya adidahiya added this to the 4.x milestone Feb 18, 2021
@blueprint-bot
Copy link

fix lint, drop test coverage

Previews: documentation | landing | table

@blueprint-bot
Copy link

fix compilation

Previews: documentation | landing | table

@adidahiya adidahiya merged commit 97837f1 into develop Feb 18, 2021
@adidahiya adidahiya deleted the ad/hotkeys2 branch February 18, 2021 19:39
@adidahiya adidahiya modified the milestones: 4.x, 4.0.0-beta.0 Mar 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment