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

QuickPick: on close shuold return focus to previously focused element #93055

Closed
alanrenmsft opened this issue Mar 19, 2020 · 7 comments
Closed
Assignees
Labels
accessibility Keyboard, mouse, ARIA, vision, screen readers (non-specific) issues quick-pick Quick-pick widget issues
Milestone

Comments

@alanrenmsft
Copy link
Contributor

  • VSCode Version: 1.43.0
  • OS Version: mac OS catalina

Steps to Reproduce:

  1. open a quick pick dialog from a button in the view header using keyboard
  2. close the dialog

Expected: the keyboard focus should return to the view header button

I have created a simple extension to reproduce the issue: https://github.com/alanrenmsft/vscode-extension

and here is the recording:
Mar-19-2020 16-26-34

This PR: #92969 will work for the scenarios where the original button is still present in the UI, but not for my scenario the view header buttons are only visible when the header is expanded and focused.

@isidorn
Copy link
Contributor

isidorn commented Mar 20, 2020

We had a somewhat similar discussion regarding focus and action bar and what should happen on escape here #91085

Though I do agree it would be best if quick pick would return focus to where it was before quick pick was opened.
Currently quick pick just passes focus to the editor. Which is a good assumption which works great most of the time.

Though since this is a feature request against quick pick forwarding to @bpasero and @chrmarti

@isidorn isidorn changed the title Accessibility - keyboard focus is not returning to the original focused element QuickPick: on close shuold return focus to previously focused element Mar 20, 2020
@isidorn isidorn added accessibility Keyboard, mouse, ARIA, vision, screen readers (non-specific) issues quick-pick Quick-pick widget issues labels Mar 20, 2020
@isidorn isidorn assigned bpasero and chrmarti and unassigned isidorn Mar 20, 2020
@bpasero bpasero removed their assignment Mar 20, 2020
@bpasero
Copy link
Member

bpasero commented Mar 20, 2020

This would probably annoy a lot of users that are used to focus returning to the editor. I would do a change only after careful consideration.

The focus is returned here:

returnFocus: () => host.focus(),

@chrmarti
Copy link
Collaborator

chrmarti commented Apr 7, 2020

Did some testing and found that this might actually work well. We need to test it during daily work to be sure. I'm not sure in which cases this might be unexpected, but it does fix some obvious cases - like when the terminal has focus, you open the command palette and then escape to find the focus switched to the editor.

chrmarti added a commit that referenced this issue Apr 7, 2020
@chrmarti
Copy link
Collaborator

chrmarti commented Apr 7, 2020

Change pushed to master for testing.

@bpasero
Copy link
Member

bpasero commented Apr 7, 2020

@chrmarti it could break any command that expects focus to be in the editor when quick pick closes (talking about the command palette). Just so that you know...

@isidorn
Copy link
Contributor

isidorn commented Apr 7, 2020

Good for pushing to master, so we see try it out and breakages early. Thanks

@chrmarti
Copy link
Collaborator

No feedback so far. Closing as fixed. :)

@github-actions github-actions bot locked and limited conversation to collaborators Jun 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accessibility Keyboard, mouse, ARIA, vision, screen readers (non-specific) issues quick-pick Quick-pick widget issues
Projects
None yet
Development

No branches or pull requests

4 participants