basicModal icon indicating copy to clipboard operation
basicModal copied to clipboard

Keyboard Support + ARIA

Open grayghostvisuals opened this issue 9 years ago • 3 comments

I don't see any ability to close modals using the esc key. I think this is a cool project that could definitely take from bootstrap's ARIA use and implement with this project…maybe even better. Thoughts?

grayghostvisuals avatar Oct 26 '16 02:10 grayghostvisuals

I've been exploring light, vanilla modal solutions. One I was considering (before I found this), here, checks for mousetrap.js as an optional dependency and uses it for keyboard control. This would be a way to add keyboard controls without adding bloat.

davidbwaters avatar Nov 08 '16 07:11 davidbwaters

ARIA support would be nice. Keyboard support is possible, but not directly part of basicModal. You can simply check if the user presses the ESC key and fire basicModal.close. It's not build-in because you might want to execute a different ESC action depending on the state of your app/site.

electerious avatar Nov 24 '16 20:11 electerious

Besides the esc key, in your demos I can't seem to tab to the x button or get out of the modal at all unless I click on the x button. I love how these work & look, but I can't use them if they're not accessible.

JacobDB avatar Feb 08 '17 22:02 JacobDB