HubSpot / vex

A modern dialog library which is highly configurable and easy to style. #hubspot-open-source
http://github.hubspot.com/vex/docs/welcome
MIT License
6.92k stars 493 forks source link

Navigating using the keyboard #92

Open franckl opened 9 years ago

franckl commented 9 years ago

Hi

I am using Vex plain theme for a simple popup like the one available on http://github.hubspot.com/vex/api/themes/ for this theme.

I tried to use the tab key to select the "ok" button but pressed it twice by mistake. At that point the control when to an element on the main page and I could not control the dialog anymore.

Is it possible to prevent this from happening ? Pressing tab key should not select elements outside the dialog if it is still visible

Thanks

adamschwartz commented 9 years ago

This absolutely is possible, but unfortunately it’s not something that vex supports directly right now. I’d love to add support for this along with other accessibility improvements.

Just to note, vex dialog’s more prescriptive design lends itself to a general solution for this but I’m not sure how well it would work with vex proper.

Interestingly enough, the Web Accessibility Initiative (WAI) has some recommendations for best practices for solving this very problem. They may help you implement a solution for yourself until we add this support into vex. Best of luck!

franckl commented 9 years ago

Hi Adam,

Thank you for your answer, I will have a look at the WAI and keep an eye on this repo if a solution is implemented.

Best