github / hotkey

Trigger an action on an element with a keyboard shortcut.
https://github.github.com/hotkey/
MIT License
3.22k stars 97 forks source link

Trigger click on anything #24

Closed muan closed 5 years ago

muan commented 5 years ago

Closes #22.

@koddsson: As discussed in our 1:1, I didn't like the idea of allowing .click() on any odd role="button" elements, but I also felt that even requiring [tabindex] with [role] would be a half measure.

So I propose–– Instead of adding role="button" into the approved list of clickable selectors, we remove the constraint altogether. This will also allow hotkey to work on Custom Elements with delegatedFocus (https://github.com/github/details-dialog-element/issues/26).

To ease my own concern with hotkey getting abused (😬), I added a paragraph to the Accessibility considerations in the README.