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

Attached <Button /> does not respond on keyboard events #1797

Closed
odragora opened this issue Jun 24, 2017 · 2 comments
Closed

Attached <Button /> does not respond on keyboard events #1797

odragora opened this issue Jun 24, 2017 · 2 comments

Comments

@odragora
Copy link

Steps

Create a Button with an attached property.

Expected Result

The button is accessible for keyboard users (hit Space or Enter and the button pressed).

Actual Result

The button does not receive keyboard input.

Version

0.70.0

Testcase

https://codepen.io/anon/pen/jwGEYJ

@layershifter
Copy link
Member

@odragora The problem is that when the Button is attached or contains a label, it's rendered as div while in all other cases as button. And it's correct in these cases.

You can use tabIndex and role props to gain focus, however will also be necessary to add a key event handler that listens for the Space key in order to be consistent with native buttons.

I'm not sure that it's should be fixed by library, but I think that we need to add an example to our docs. @levithomason what you think?

@levithomason
Copy link
Member

Hm, it seems the responsible thing to do here is to render the div with the appropriate props to behave as a button.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants