Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

data viewer should gain keyboard focus when activated #2451

Open
Tracked by #7600
kevinushey opened this issue Mar 19, 2018 · 5 comments
Open
Tracked by #7600

data viewer should gain keyboard focus when activated #2451

kevinushey opened this issue Mar 19, 2018 · 5 comments

Comments

@kevinushey
Copy link
Contributor

System details

RStudio Edition : Desktop
RStudio Version : v1.2.440
OS Version      : macOS 10.13.3
R Version       : 3.4.4

Steps to reproduce the problem

Open the data viewer with e.g. View(mtcars). Then attempt to scroll using the arrow keys.

Describe the problem in detail

The viewer is not scrolled.

Describe the behavior you expected

The data viewer should gain keyboard focus after activation, so that one can easily scroll with the keyboard. In the same vein, Ctrl + 1 should transfer focus to an open data viewer when possible as well.

@adamconroy
Copy link
Contributor

@gtritchie what is your opinion on this for accessibility? I'm not sure if focus stealing would be good or bad in this case. I can see an argument wanting to keep the focus in the terminal as well.

@gtritchie gtritchie added this to To do in Accessibility (Open Source 1.4) via automation Apr 14, 2020
@gtritchie
Copy link
Member

Agree with Kevin, data viewer should get keyboard focus when opened with View and when opened with Ctrl+1. It's fine for a different part of the UI to get focus as result of a user action.

Several similar interwoven issues that I'll be working on in 1.4, so feel free to assign to me. For example, see #5652.

@gtritchie
Copy link
Member

The major case where a pane shouldn't grab focus as a result of user action is when navigating between tabs with keyboard (e.g. as you captured in #5515.

@adamconroy
Copy link
Contributor

👍

@gtritchie gtritchie added this to the v1.4 milestone Apr 14, 2020
@gtritchie gtritchie moved this from To do to Review in Accessibility (Open Source 1.4) Jul 30, 2020
@gtritchie gtritchie moved this from Review to To do in Accessibility (Open Source 1.4) Jul 30, 2020
@gtritchie gtritchie moved this from To do to Review in Accessibility (Open Source 1.4) Aug 10, 2020
@gtritchie gtritchie modified the milestones: v1.4, v1.5 Aug 10, 2020
@gtritchie
Copy link
Member

This is closer to working; the source columns F6 pane-switching work done by @melissa-barca now results in the data viewer's toolbar getting keyboard focus. However you still cannot tab into the actual grid and use the arrows to scroll.

I did try giving the dataTables_scrollBody element tabindex=0 which DOES enable the ability to put focus on it and scroll with arrows, but several issues would still need to be resolved.

  • the column headings (for sorting, filtering, etc) also accept keyboard focus, but have no visible focus indicators so it seems like nothing is happening when you start tabbing around (can be fixed with some styling)
  • when the scrollBody has tabindex=0, even clicking on with the mouse causes focus rectangle to show, thus likely need to hook up focus-visible polyfill inside this iframe
  • when the scrollBody has focus, the focus rectangle is ugly, and some parts are not visible; so more styling work needed

So, all told, too much to mess with for 1.4; moving to 1.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants