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

React-hotkeys not working with lazy import #335

Open
MDalprato opened this issue Feb 14, 2022 · 0 comments
Open

React-hotkeys not working with lazy import #335

MDalprato opened this issue Feb 14, 2022 · 0 comments

Comments

@MDalprato
Copy link

Describe the bug
Hotkeys fires only once and the only way to fire them again it to set the focus on another element.

How are you using react hotkeys components? (HotKeys, GlobalHotKeys, IgnoreKeys etc)

Expected behavior
Hotkeys events should always works.

Platform (please complete the following information):

  • Version of react-hotkeys (latest)
  • Browser [e.g. chrome, safari] (chrome and safari)
  • OS: [e.g. iOS] (macOS and Windows)

If I import the component using the lazy option the hotkeys action fires only once.

const Test = lazy(() => import("./components/dashboard/Test"));

If I import the component using the 'standard' react options the hotkeys works fine:

import {Test} from "./components/dashboard/Test";

I'm not able to find a solution to this issue.

@MDalprato MDalprato changed the title [BUG] React-hotkeys not working with lazy import Feb 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant