Skip to content

Fix useKeyboard example #759

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

Merged
merged 1 commit into from
Jul 15, 2020
Merged

Fix useKeyboard example #759

merged 1 commit into from
Jul 15, 2020

Conversation

spbyrne
Copy link
Contributor

@spbyrne spbyrne commented Jul 15, 2020

In the useKeyboard doc it has an example using both the onKeyDown and onKeyUp handlers, but both were actually using onKeyDown. I've changed the second handler to onKeyUp since it seems that was intended.

  let {keyboardProps} = useKeyboard({
    onKeyDown: e => setEvents(
      events => [`key down: ${e.key}`, ...events]
    ),
    onKeyUp: e => setEvents(
      events => [`key up: ${e.key}`, ...events]
    )
  });

@devongovett
Copy link
Member

Thank you!

@devongovett devongovett merged commit 9079e41 into adobe:main Jul 15, 2020
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

Successfully merging this pull request may close these issues.

2 participants