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

Arrow keys doesnt work on first render #76

Open
damianfilipek81 opened this issue Jun 17, 2021 · 1 comment
Open

Arrow keys doesnt work on first render #76

damianfilipek81 opened this issue Jun 17, 2021 · 1 comment

Comments

@damianfilipek81
Copy link

Hi,
i noticed that controll with arrow keys does not work on first render. I have to click somewhere on site and then it is working, but if you dont then it just scrolls to blank page. Anyone have some solution for that problem?
I tried to force click event but it doesnt do much.

If you have a solution please reply, thanks!

@ixam1
Copy link

ixam1 commented Aug 13, 2021

I had the same problem, add the following to the first section of your page:

<div
  tabIndex="0"
  ref={(input) => input && input.focus()}
>

This will focus the element on first render and enable arrow keys.

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

2 participants