adobe/brackets — pull request #3496 by redmunds (2013-04-19 17:53:02+00:00)
Title: Quick Docs Keyboard Navigation

This change sets focus to the scroller element in the Quick Docs inline editor so default keyboard navigation works and Ctrl-K also closes the inline editor. Also changed quiet-scrollbars to display on :focus (in addition to :hover).

Below are questions from @peterflynn (I copied from IRC) cc: @njx, @adrocknaphobia , @GarthDB

1) Should it take focus away from the host editor automatically when opened? Adam says yes and it's consistent with inline editors, so this might be already resolved
[redmunds] This was implemented.

2) Should there be some sort of indicator that it has focus? Garth says no, but I'm not as sure (see next issue)
[redmunds] quiet-scrollbars now display on focus, but this only works for content tall enough to scroll.

3) What happens when you click inside the widget but outside the scrollable part of it? Right now, focus goes to some weird part of the host editor's CM wrapper, where pressing the arrows actually scrolls the host editor but typing letters doesn't edit the host editor. Tthat seems bad, except that afaict you can't make the text there selectable without allowing it to take focus, so I'm not sure what the right answer is there. we could let it take focus, but then capture arrow keys & pipe them over to the scrollable part of the docs or something... but that seems hard to get right
[redmunds] Focus is not in a usable place, but nothing bad seems to happen. Easy to change focus with mouse. Only way to change focus with keyboard is using Ctrl-K (but have to hit it twice).

4) Is there a gesture to jump focus in & out of the inline widget? we've talked about doing this for inline editors, but it seems even more useful here -- especially if it steals focus by default (because you'll often want to type in the code while looking at the docs, Esc to close isn't a good enough way to resolve this)

5) should scrolling with arrow keys momentarily make the quiet scrollbars visible? that's how Lion scrollbars work, but currently our quiet scrollbars don't do that. it could make scrolling with arrow keys feel confusing
[redmunds] quiet-scrollbars now display on focus