Improve keyboard accessibility
Closes #139
- Allows for closing active overlays/ambassador cards with escape
- Better experience navigating with tab
- Auto focus overlays/ambassador cards when opened
- Adding/removing tab indexes for what should & shouldn't be focusable w/ tab
- Don't sleep when an element in the overlay is focused
Sorry for the delay on getting to this @flakey5, been pretty busy with some upcoming secret bits for Alveus. Any chance you could rebase this?
Sorry for taking so long to get to this
No worries at all!
Addressed some of the review comments in latest commit, trying to see if there's a better way to detect when we should pause the sleeping timer though.
Right now when we detect that we're focusing the app it also detects when we focus on child elements, so every time we tab to different overlays, ambassadors, etc. the event fires and calls caffeinate and the same happens with onBlur/uncaffeinate. I feel like ideally we can just detect when we app is focused/unfocused, but I'm not fully familiar with front end stuff to know if there's an actual good way to do that, wdyt?
Yeh, I think my concern is that the focus event can be fired by things other than keyboard navigation -- clicking on a button or really anything with a tab index will generally cause it to become focused, I think?