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

[no-noninteractive-element-interactions] should accept the dialog role #741

Closed
dfernandez79 opened this issue Sep 7, 2020 · 1 comment
Closed

Comments

@dfernandez79
Copy link

dfernandez79 commented Sep 7, 2020

Currently if you have code like this:

<div role="dialog" onKeyPress={handleEscKey}>{contents}</div>

The rule no-noninteractive-element-interactions will fail. However, closing a dialog with the Esc is a common pattern also suggested by the WAI-ARIA practices site: https://www.w3.org/TR/wai-aria-practices-1.2/examples/dialog-modal/datepicker-dialog.html (the linked example has a keyDown handler in the div with the dialog role).

The lint rule passes with role="presentation" which is incorrect for this case.

@dfernandez79
Copy link
Author

I'm closing this issue.

If the "dialog" contains any interactive elements the work around of moving the handler down will work.

I prefer to use bubbling to handle this, but also I'm not so happy about having a onKeyPress handler in an non-focusable element.

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